I had a need to backup my server to a NAS using samba. I'm sure there may be others out there with such a need to backup across a network to a samba share.
This script was pieced together in part by script authored by Brice Burgess in an article at the following link:
Linux.com | Backing up your Linux desktop with rsync
As well as a script written by cvidal who is a contributor to Zimbra. I pieced in the areas related to the mounting of network drives. The nice thing about the script is that it keeps rotating backups for better redundancy. You can have a look at it and adjust to your liking. I hope people find it useful.
You will need to do the following to make it executable and then insert as a cron job:
Create a file named multi_backup.sh and copy/paste the contents of the attached text file.
#chmod +x multi_backup.sh
#cp multi_backup.sh /usr/local/bin/
#cd /etc/cron.daily
#ln -s /usr/local/bin/multi_backup.sh .
It will run with cron dailys from there.
The following will rotate the log file:
To rotate the logs, add a file named "zimbak" under /etc/logrotate.d/ with the lines:
/var/log/zimbak.log {
missingok
notifempty
}
Big thanks to cvidal for those inserting pieces above.
script:
multi_backup.txt