I'm stuck at the first hurdle!
I want to run a couple of commands from a bash script. First something like this to rsync some directories:
rsync -e ssh -az [email protected]:/home /location/of/local/folder Then something like this to tar and copy the files somewhere else:
cd /location/of/local/folder tar zcf /var/backups/home-`date +%Y%m%d`.tar.gz home I hope this is making sense.
The problem is that obviously I wish for the rsync to finish before the directory is tar'd. So is there a bit of code I can use to make sure that rsync has finished before running the tar command?
e.g. (pseudo code)
rsync while(is syncing){ sleep 10 } tar Or will my .sh script only run the next line after the first line has finished and exited?