IBackup for linux » History » Revision 8
Revision 7 (Jamila Khan, 04/26/2018 11:07 AM) → Revision 8/9 (Jamila Khan, 08/16/2018 02:45 PM)
h1. IBackup for linux
h2. installing and configuring IBackup perl scripts
<pre>
cd /usr/local/sbin
wget https://www.ibackup.com/online-backup-linux/downloads/download-for-linux/IBackup_for_Linux.zip
unzip IBackup_for_Linux.zip
cd IBackup_for_Linux
chmod a+x *.pl
./Account_Setting.pl
</pre>
Enter your
* username
* password
* key
* backup location (defaults to hostname)
* restore location (they recommend using @/home/@)
* restore from location (defaults to hostname)
* email ID
* retain logs? YES
* select Backup type: 1 (mirror)
!https://www.ibackup.com/source/images/ibackup-account-settings-new.jpg!
It then asks if you want to log in, say yes.
* Add the list of files to back up to BackupsetFile.txt
* Add the list of files to exclude to FullExcludeList.txt, PartialExcludeList.txt, and/or RegexExcludeList.txt, depending on how you want to exclude them.
h2. setting up backupninja jobs
<pre>
cd /etc/backup.d
</pre>
create 56-iBackup.sh with contents:
<pre>
#!/bin/sh
cd /usr/local/sbin/IBackup_for_Linux/
OUTPUT=$((
/usr/local/sbin/IBackup_for_Linux/Backup_Script.pl --silent
) 2>&1)
if [ $? -ne 0 ]
then
warning $OUTPUT
fi
</pre>
create 57-iBackup_test.sh
remember to change the path to include your username
<pre>
#!/bin/sh
## YOU MUST CHANGE THIS TO REFLECT THE LOCAL PATH
path="/usr/local/sbin/IBackup_for_Linux/user_profile/USERNAME/Backup/Manual/LOGS"
# declare variables for checking the timestamp against
today=`date "+%a %b %e"`
yesterday=`date -d "yesterday" "+%a %b %e"`
cnt=`ls -l $path |grep "$today\|$yesterday"| wc -l`
# find if there are errors
errorcnt=`find $path -name **"$yesterday"** -exec cat {} \; | grep "failed to backup" | rev | cut -d ' ' -f 1| rev`
errors=`find $path -name **"$yesterday"** -exec cat {} \; | grep -i -A 6 "Error Report"`
# for testing
#echo -e "$today \n $yesterday \n $cnt \n $errorcnt \n $errors"
OUTPUT=$((
if [ $cnt -eq 0 ] ; then
echo "CRITICAL - A backup did not run on $yesterday!"
exit 2
fi
if [ $errorcnt -ne 0 ] ; then
echo "CRITICAL - $errorcnt Errors in backup!\n$errors"
exit 2
else echo "OK - Backup ran $yesterday with no errors"
exit 0
fi
) 2>&1)
if [ $? -ne 0 ]
then
warning $OUTPUT
fi
</pre>
For newer versions of the program:
<pre>
#!/bin/sh
## YOU MUST CHANGE THIS TO REFLECT THE LOCAL PATH
#path="/usr/local/sbin/IBackup_for_Linux/user_profile/palantetech/Backup/Manual/LOGS"
path="/usr/local/sbin/ibackup/user_profile/palantetech/Backup/Manual/LOGS"
# declare variables for checking the timestamp against
#today=`date "+%a %b %e"`
#yesterday=`date -d "yesterday" "+%a %b %e"`
today=`date "+%s" | cut -c -4`
yesterday=`date -d "yesterday" "+%s" | cut -c -4`
cnt=`ls -l $path |grep "$today\|$yesterday"| wc -l`
# find if there are errors
errorcnt=`find $path -name **"$yesterday"** -exec cat {} \; | grep "failed to backup" | rev | cut -d ' ' -f 1| rev`
errors=`find $path -name **"$yesterday"** -exec cat {} \; | grep -i -A 6 "Error Report"`
# for testing
#echo -e "$today \n $yesterday \n $cnt \n $errorcnt \n $errors"
OUTPUT=$((
if [ $cnt -eq 0 ] ; then
echo "CRITICAL - A backup did not run on $yesterday!"
exit 2
fi
if [ $errorcnt -ne 0 ] ; then
echo "CRITICAL - $errorcnt Errors in backup!\n$errors"
exit 2
else echo "OK - Backup ran $yesterday with no errors"
exit 0
fi
) 2>&1)
if [ $? -ne 0 ]
then
warning $OUTPUT
fi
</pre>
Developed from
https://www.ibackup.com/online-backup-linux/readme.htm
https://hq.palantetech.coop/issues/25142
Go to top