I'm trying to run multiple rsync commands from a bash script but only the first one fires. I've tried linking the commands with &&
and ;
but neither work.
#! /bin/bash
rsync -ahPr --delete-excluded --exclude='.DS_Store' --exclude=Caches/ --ignore-errors --stats --log-file=$LOGFILE --files-from=$FILESFROM ~/$SOURCE /Volumes/$DEST &&
rsync -avh --progress ~/.profile /Volumes/$DEST/_profile/profile &&
rsync -avh --progress ~/.gitconfig /Volumes/$DEST/_profile/gitconfig &&
rsync -avh --progress ~/.ssh/ /Volumes/$DEST/_profile/ssh/ &&
rsync -avh --progress ~/.vim/ /Volumes/$DEST/_profile/vim/
I'm doing the last 4 commands as seperate ones because I'm renaming the files/directories on the fly—not sure if there's a better way to do this?
I'm executing the script with bash -x myscript.sh
to see if it comes up with any errors, but no.
&&
from your script.