D&C GLug - Home Page

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

Re: [LUG] Automating rsync

 

On 03/08/14 15:35, Julian Hall 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

Thanks for all the replies :) I'll try it tomorrow. Once that works I'll look into making it a cron job to run the same time as I do t manually now.. about 6pm on a Sunday.

Julian

PS I know.. I can't count.. 5 partitions :)

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