Hi all, I want to do an rsync of my qmailtoaster directory (/home/vpopmail, /var/qmail, etc) from another machine. Since this involves several directory, can anyone help me how to make the bash script so that the second rsync command will wait util the first rsync command finishes? I think we can use sleep command, but I'm sure there is more appropriate ways (such as using exit code?) I imagine the script will be like this (pls mind the word wrap): #!/bin/bash rsync -avzgorp --delete -e ssh root@xxxxxxxxxxxxx:/var/qmail/ /var/qmail/ if ok then: rsync -avzgorp --delete -e ssh root@xxxxxxxxxxxxx:/home/vpopmail/ /home/vpopmail/ if ok then: rsync -avzgorp --delete -e ssh root@xxxxxxxxxxxxx:/var/log/qmail/ /var/log/qmail/ if ok then: rsync -avzgorp --delete -e ssh root@xxxxxxxxxxxxx:/var/log/maildrop/ /var/log/maildrop/ if ok then: rsync -avzgorp --delete -e ssh root@xxxxxxxxxxxxx:/etc/mail/ /etc/mail/ if ok then: rsync -avzgorp --delete -e ssh root@xxxxxxxxxxxxx:/.spamassassin/ /.spamassassin/ if ok then: rsync -avzgorp --delete -e ssh root@xxxxxxxxxxxxx:/etc/tcprules.d/ /etc/tcprules.d/ fi done Thank you very much, -- Fajar Priyanto | Reg'd Linux User #327841 | Linux tutorial http://linux2.arinet.org 12:26:40 up 3:16, 2.6.15-1.1830_FC4 GNU/Linux Let's use OpenOffice. http://www.openoffice.org