Backup to spare drive (rsync / crontab)
peter at boosten.org
Fri Jan 30 11:28:52 PST 2009
drcubi at yahoo.com wrote:
> I am using rsync and crontab to perform scheduled backups on FreeBSD AMD64 Rel. 7.0
> I am following process described here for rsync :
> I have a backup script's created for daily, weekly, monthly.
> This is one example - the daily (/backup is a seperate physical drive) :
> #daily backup script
> rsync -a --delete /usr/home/data/Access/ /backup/daily/Access
> rsync -a --delete /usr/home/data/Templates/ /backup/daily/Templates
> rsync -a --delete /usr/home/QBdata/ /backup/daily/QBdata
> rsync -a --delete /usr/home/reception1/ /backup/daily/reception1
> rsync -a --delete /usr/home/reception2/ /backup/daily/reception2
> rsync -a --delete /usr/home/reception3/ /backup/daily/reception3
> rsync -a --delete /usr/home/data/Files/ /backup/daily/Files
> All files created where chmod'd with +x, then I test the scripts by running them manually and all three, daily, weekly & monthly work fine.
> FInal step, I add to root crontab, by using :
> crontab -e
> I added following lines :
> 1 23 30 * * /usr/local/sbin/backup/monthly
> 1 21 * * 0 /usr/local/sbin/backup/weekly
> 1 23 * * 1-5 /usr/local/sbin/backup/daily
> crontab -l shows all is OK as well.
> But the scheduled backups never happen. I must be doing something wrong, but can't figure out what.
rsync isn't in the path of cron. You should either provide the complete
path in the script, of add /usr/local/bin to your crontab.
More information about the freebsd-questions