I am performing a dry run using Rsync on 2 different boxes.

While i'm doing that, Under destination directory, I want a specific directory x to be ignored for sync.

Please let me know the exact pattern to ignore the directory.

The current command I'm using is:


under DESTINATION_IP, I would want to ignore a particular directory under REMOTE_DIR.


If you looked at the arguments for rsync, you would have seen:

--exclude=PATTERN       exclude files matching PATTERN

So with that, I would suggest the following dry run:

rsync -avnc --delete --exclude=x $LOCAL_DIR $USERNAME@$DESTINATION_IP:$REMOTE_DIR



Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.