Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: edb on April 15, 2005, 09:30:15 PM
-
I want to enable a scheduled rsync session to backup my files to another server every day at midnight.
I created a script called /root/backup.sh which I tested from the command line and it works great.
The file contains these commands:
#!/bin/sh
rsync -R -av /home/* 192.168.225.50::servername/server11
rsync -R -av /etc/* 192.168.225.50::servername/server11
rsync -R -av /opt/* 192.168.225.50::servername/server11
rsync -R -av /plus/* 192.168.225.50::servername/server11
rsync -R -av /root/* 192.168.225.50::servername/server11
rsync -R -av /usr/* 192.168.225.50::servername/server11
rsync -R -av /bin/* 192.168.225.50::servername/server11
rsync -R -av /sbin/* 192.168.225.50::servername/server11
rsync -R -av /var/* 192.168.225.50::servername/server11
rsync -R -av /lib/* 192.168.225.50::servername/server11
rsync -R -av /boot/* 192.168.225.50::servername/server11
rsync -R -av /command/* 192.168.225.50::servername/server11
rsync -R -av /service/* 192.168.225.50::servername/server11
rsync -R -av /aquota.group 192.168.225.50::servername/server11
rsync -R -av /aquota.user 192.168.225.50::servername/server11
I added an entry in /etc/e-smith/templates-custom/etc/crontab/rsync with the following contents:
# Daily System Backup Script
0 0 * * * root /root/backup.sh
I expanded the template and restarted cron but it won't work. Any ideas?
Thanks
Ed
-
The file contains these commands:
#!/bin/sh
rsync -R -av /home/* 192.168.225.50::servername/server11
rsync -R -av /etc/* 192.168.225.50::servername/server11
...
You're writing to an anonymous drop area. Anyone else on your LAN could do that as well, presumably. Very insecure - you're backups couldn't be relied upon.
Instead, use "rsync -e ssh" and set up public key based ssh authentication.
...
rsync -R -av /usr/* 192.168.225.50::servername/server11
rsync -R -av /bin/* 192.168.225.50::servername/server11
rsync -R -av /sbin/* 192.168.225.50::servername/server11
...
Those directories should only contain stuff installed from CDROM, or from RPMs. You don't need to back it up, since you'll be restoring to a fresh install.
# Daily System Backup Script
0 0 * * * root /root/backup.sh
I expanded the template and restarted cron but it won't work. Any ideas?
The expanded template probably doesn't have execute permission set. Try "sh /root/backup.sh" in your cron fragment.
-
Thanks Charlie