IBackup for linux » History » Version 7
Jamila Khan, 04/26/2018 11:07 AM
1 | 1 | Jamila Khan | h1. IBackup for linux |
---|---|---|---|
2 | |||
3 | h2. installing and configuring IBackup perl scripts |
||
4 | |||
5 | <pre> |
||
6 | cd /usr/local/sbin |
||
7 | 3 | Jamila Khan | wget https://www.ibackup.com/online-backup-linux/downloads/download-for-linux/IBackup_for_Linux.zip |
8 | 1 | Jamila Khan | unzip IBackup_for_Linux.zip |
9 | cd IBackup_for_Linux |
||
10 | chmod a+x *.pl |
||
11 | 4 | Jamila Khan | ./Account_Setting.pl |
12 | 1 | Jamila Khan | </pre> |
13 | |||
14 | Enter your |
||
15 | * username |
||
16 | * password |
||
17 | * key |
||
18 | * backup location (defaults to hostname) |
||
19 | * restore location (they recommend using @/home/@) |
||
20 | * restore from location (defaults to hostname) |
||
21 | * email ID |
||
22 | * retain logs? YES |
||
23 | 5 | Jamila Khan | * select Backup type: 1 (mirror) |
24 | 1 | Jamila Khan | |
25 | !https://www.ibackup.com/source/images/ibackup-account-settings-new.jpg! |
||
26 | |||
27 | 2 | Jamila Khan | It then asks if you want to log in, say yes. |
28 | |||
29 | * Add the list of files to back up to BackupsetFile.txt |
||
30 | * Add the list of files to exclude to FullExcludeList.txt, PartialExcludeList.txt, and/or RegexExcludeList.txt, depending on how you want to exclude them. |
||
31 | 1 | Jamila Khan | |
32 | h2. setting up backupninja jobs |
||
33 | |||
34 | <pre> |
||
35 | cd /etc/backup.d |
||
36 | </pre> |
||
37 | |||
38 | create 56-iBackup.sh with contents: |
||
39 | |||
40 | <pre> |
||
41 | #!/bin/sh |
||
42 | |||
43 | cd /usr/local/sbin/IBackup_for_Linux/ |
||
44 | |||
45 | OUTPUT=$(( |
||
46 | |||
47 | 7 | Jamila Khan | /usr/local/sbin/IBackup_for_Linux/Backup_Script.pl --silent |
48 | 1 | Jamila Khan | |
49 | ) 2>&1) |
||
50 | |||
51 | if [ $? -ne 0 ] |
||
52 | then |
||
53 | warning $OUTPUT |
||
54 | fi |
||
55 | </pre> |
||
56 | |||
57 | create 57-iBackup_test.sh |
||
58 | remember to change the path to include your username |
||
59 | |||
60 | <pre> |
||
61 | #!/bin/sh |
||
62 | |||
63 | |||
64 | ## YOU MUST CHANGE THIS TO REFLECT THE LOCAL PATH |
||
65 | 6 | Jamila Khan | path="/usr/local/sbin/IBackup_for_Linux/user_profile/USERNAME/Backup/Manual/LOGS" |
66 | 1 | Jamila Khan | |
67 | # declare variables for checking the timestamp against |
||
68 | today=`date "+%a %b %e"` |
||
69 | yesterday=`date -d "yesterday" "+%a %b %e"` |
||
70 | cnt=`ls -l $path |grep "$today\|$yesterday"| wc -l` |
||
71 | |||
72 | # find if there are errors |
||
73 | 6 | Jamila Khan | errorcnt=`find $path -name **"$yesterday"** -exec cat {} \; | grep "failed to backup" | rev | cut -d ' ' -f 1| rev` |
74 | errors=`find $path -name **"$yesterday"** -exec cat {} \; | grep -i -A 6 "Error Report"` |
||
75 | 1 | Jamila Khan | |
76 | # for testing |
||
77 | #echo -e "$today \n $yesterday \n $cnt \n $errorcnt \n $errors" |
||
78 | |||
79 | 6 | Jamila Khan | OUTPUT=$(( |
80 | 1 | Jamila Khan | |
81 | 6 | Jamila Khan | if [ $cnt -eq 0 ] ; then |
82 | echo "CRITICAL - A backup did not run on $yesterday!" |
||
83 | exit 2 |
||
84 | 1 | Jamila Khan | fi |
85 | |||
86 | 6 | Jamila Khan | if [ $errorcnt -ne 0 ] ; then |
87 | echo "CRITICAL - $errorcnt Errors in backup!\n$errors" |
||
88 | exit 2 |
||
89 | |||
90 | else echo "OK - Backup ran $yesterday with no errors" |
||
91 | 1 | Jamila Khan | exit 0 |
92 | 6 | Jamila Khan | fi |
93 | 1 | Jamila Khan | |
94 | ) 2>&1) |
||
95 | |||
96 | if [ $? -ne 0 ] |
||
97 | then |
||
98 | warning $OUTPUT |
||
99 | fi |
||
100 | </pre> |
||
101 | |||
102 | |||
103 | Developed from |
||
104 | https://www.ibackup.com/online-backup-linux/readme.htm |
||
105 | https://hq.palantetech.coop/issues/25142 |