D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Automating rsync

 


On 3 Aug 2014 15:36, "Julian Hall" <linux@xxxxxxxxxxxx> wrote:
>
> Hi All,
>
> I have four partitions I backup weekly to a USB drive using rsync and I'd like to automate it with a bash script. ÂLooking online I can't quite work out if the following would work:
>
> #!/bin/sh
>
> # MINT /
> rsync -aAXv /* /media/julian/ARTEMIS/MINT --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*}
> # MINT /home
> rsync -aAXv /home* /media/julian/ARTEMIS/MINT_HOME
> # WINDOWS XP
> rsync -aAXv /media/julian/NATALIE /media/julian/HECATE/WINDOWS_XP
> # WINDOWS 7
> rsync -aAXv /media/julian/WINDOWS7 /media/julian/HECATE/WINDOWS_7
> # WINDOWS My Documents
> rsync -aAXv /media/julian/CYNTHIA /media/julian/HECATE/WINDOWS_DOCUMENTS
>
> Would it run the first command, wait until it's finished, and then run the next in sequence, or try to run it all at once? ÂProbably a really stupid question as all my prior programming experience says it would run each command and wait, but never having used a bash script I thought i would ask the experts first :)
>
> Kind regards,
>
> Julian

I'm on my phone and the layout could be a little off, but if the commands are as they look to me then they should run sequentially rather than in parallel.

Are you going to have them run through cron?

Grant

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq