Our Samba server is running FreeBSD 8.2, just upgraded from 6.1 that had served us well until a drive started to die. My backup method fails, but I can't find my mistake. Hope someone else can. First I created backup scripts, these typically look like:
This is the weekly script, there are others. If I run this manually it works fine. The permissions of these files are as follows:
Next when su'd to root, I edited crontab by using
root's crontab looks like this:
The two tests at the end is just me playing around and watching logs, hence the odd times. After the allotted time, for example the test at 14:30, this is what the cron log shows:
Everything looks fine, but no files get copied to the 1.5Tb (/opft) backup drive. As you can see I have tested crontab with /bin/sh preceding the script and without. Same result both ways, cron log looks fine, nothing gets copied. Does anyone know why?
One final point, I didn't know if rsync expects the directory structure at the destination so I have created the main directories.
Thanks to all that take the time to read this
Code:
#!/bin/sh
rsync -a --delete /usr/home/access/ /opft/main/weekly/access/
rsync -a --delete /usr/home/engineers/ /opft/main/weekly/engineers/
rsync -a --delete /usr/home/files/ /opft/main/weekly/files/
rsync -a --delete /usr/home/pacsdata/ /opft/main/weekly/pacsdata/
rsync -a --delete /usr/home/reception/ /opft/main/weekly/reception/
rsync -a --delete /usr/home/accounting/ /opft/main/weekly/accounting/
This is the weekly script, there are others. If I run this manually it works fine. The permissions of these files are as follows:
Code:
-rwxr-xr-x 1 root wheel 188 Jun 18 12:46 admin.sh
-rwxr-xr-x 1 root wheel 417 Jun 18 12:45 dailyMWF.sh
-rwxr-xr-x 1 root wheel 410 Jun 18 12:44 dailyTT.sh
-rwxr-xr-x 1 root wheel 64 Jun 18 16:56 test.sh
-rwxr-xr-x 1 root wheel 404 Jun 18 12:43 weekly.sh
Next when su'd to root, I edited crontab by using
crontab -e
root's crontab looks like this:
Code:
#Minute hour mday month wday who command
#
1 22 * * 1-5 /bin/sh /usr/local/etc/backup/admin.sh
15 0 * * 0 /bin/sh /usr/local/etc/backup/weekly.sh
15 22 * * 1,3,5 /bin/sh /usr/local/etc/backup/dailyMWF.sh
15 22 * * 2,4 /bin/sh /usr/local/etc/backup/dailyTT.sh
54 16 * * 1,6 /usr/local/etc/backup/test.sh
30 14 * * 0 /bin/sh /usr/local/etc/backup/test.sh
The two tests at the end is just me playing around and watching logs, hence the odd times. After the allotted time, for example the test at 14:30, this is what the cron log shows:
Code:
Jun 19 14:30:00 crash /usr/sbin/cron[78543]: (root) CMD (/bin/sh /usr/local/etc/backup/test.sh)
Everything looks fine, but no files get copied to the 1.5Tb (/opft) backup drive. As you can see I have tested crontab with /bin/sh preceding the script and without. Same result both ways, cron log looks fine, nothing gets copied. Does anyone know why?
One final point, I didn't know if rsync expects the directory structure at the destination so I have created the main directories.
Thanks to all that take the time to read this