Hi all,
I am running Ubuntu server 10.04 and use rsync to do all my backups. I would
like to backup multiple directories to my external hard drive, but I am
faced with a problem on how to set up crontab -e to allow each rsync
statement to perform one after the other. Right now I have each one set to
run on different nights, but I would like them all to run the same night to
allow for a more efficient backup. I know I could just run them at different
times in the same night, but I don't want to chance one not completing
before the other starts. Can I just list them one after the other like so in
crontab -e:
# m h dom mon dow command
00 4 * * 7 rsync -auv --delete /Godfather/Music /Backup
rsync -auv --delete /Godfather/Documents /Backup
rsync -auv --delete /Godfather/Setups /Backup
rsync -auv --delete /Godfather/Pictures /Backup
rsync -auv --delete /Godfather/Backups /Backup
rsync -auv --delete /Godfather/Videos /Backup
This is my current crontab -e
# m h dom mon dow command
00 4 * * 7 rsync -auv --delete /Godfather/Music /Backup
00 4 * * 6 rsync -auv --delete /Godfather/Documents /Backup
00 4 * * 5 rsync -auv --delete /Godfather/Setups /Backup
00 4 * * 4 rsync -auv --delete /Godfather/Pictures /Backup
00 4 * * 3 rsync -auv --delete /Godfather/Backups /Backup
00 4 * * 2 rsync -auv --delete /Godfather/Videos /Backup
Thanks in advance!
--
View this message in context:
http://old.nabble.com/Rsync-sequence-tp29210771p29210771.html
Sent from the Samba - rsync mailing list archive at Nabble.com.
On Mon 19 Jul 2010, dschuett wrote:> allow for a more efficient backup. I know I could just run them at different > times in the same night, but I don't want to chance one not completing > before the other starts. Can I just list them one after the other like so in > crontab -e: > > # m h dom mon dow command > 00 4 * * 7 rsync -auv --delete /Godfather/Music /Backup > rsync -auv --delete /Godfather/Documents /Backup > rsync -auv --delete /Godfather/Setups /Backup > rsync -auv --delete /Godfather/Pictures /Backup > rsync -auv --delete /Godfather/Backups /Backup > rsync -auv --delete /Godfather/Videos /BackupThis is hardly an rsync question... I would put the commands in a separate shell script file: #!/bin/sh rsync -auv --delete /Godfather/Music /Backup rsync -auv --delete /Godfather/Documents /Backup rsync -auv --delete /Godfather/Setups /Backup rsync -auv --delete /Godfather/Pictures /Backup rsync -auv --delete /Godfather/Backups /Backup rsync -auv --delete /Godfather/Videos /Backup Then make the file executable (chmod +x) and then put the name of the script in the crontab. Paul
> Can I just list them one after the other like so in crontab -eYou may wish to also consider using a single rsync command : rsync -auv --delete \ /Godfather/Documents \ /Godfather/Setups \ /Godfather/Pictures \ /Godfather/Backups \ /Godfather/Videos \ /Backup # backup destination With this approach I am not sure which order the source directories will be copied? If the execution order is critical then you are probably best to stick to a separate command for each source directory in a script as has been previously suggested. Finally, I recommend excessing extreme caution when using the --delete option. I hope this helps. --------------------------- This email is protected by LBackup, an open source backup solution. http://www.lbackup.org