Rsync sequence

McGraw, Robert P rmcgraw at purdue.edu
Tue Jul 20 09:34:05 MDT 2010


I have one script that has multiple rsync to a backup server. I do not want them all running at the same time but I want to be sure that they all complete.

What I do is use the sh wait command link

	rsync ..... &
	rsync ..... &

      Wait

      rsync ..... &
      rsync ..... &

      wait

And so on


It will run the rsyncs in the background but will wait until both have finished until it runs the next two rsync.

Robert



> -----Original Message-----
> From: rsync-bounces at lists.samba.org [mailto:rsync-
> bounces at lists.samba.org] On Behalf Of Paul Slootman
> Sent: Tuesday, July 20, 2010 5:19 AM
> To: dschuett
> Cc: rsync at lists.samba.org
> Subject: Re: Rsync sequence
> 
> 
> 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 /Backup
> 
> This 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
> --
> Please use reply-all for most replies to avoid omitting the mailing
> list.
> To unsubscribe or change options:
> https://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-
> questions.html



More information about the rsync mailing list