I have two local copies of a website (mysite and mysite2) and I need to upload the files missing from mysite2 with FTP to a remote server. So I want to use rsync --compare-dest to generate a third directory with the differences.

However, this command (using dry-run) is not working:

rsync -azhvn --ignore-existing --compare-dest=/var/www/mysite2/sites/default/files/wp-content/uploads/  /var/www/mysite/wp-content/uploads/ /var/www/mynewsite/sites/default/files/wp-content/uploads/

It copies all the files from mysite as if the compare-dest argument is ignored.

If I omit --compare-dest and change to:

rsync -azhvn --ignore-existing /var/www/mysite/wp-content/uploads/ /var/www/mysite2/sites/default/files/wp-content/uploads/

it works, except of course that I don't get my third directory with the changes.

What am I doing wrong?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.