Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just wondered if someone could clarify quickly.

I've got multiple servers storing email, and as I'm migrating the MX records from server to server, I want to ensure consistency by means of rsync.

My plan is to run rsync -az on the new server, grabbing any messages that might still find it's way to the old server.

I'm still new to using it like this, but as I understand rsync, it's incremental.

That said, I know the "a" option evaluates to a lot of other options, so I just want to make sure that I'm not going to cause files on the new server that don't exist on the old one to be deleted as a result of using this command.

Also, if there's a better way of doing this, so that both the new and old server are entirely in sync regardless of where new messages might appear, please let me know.

Thanks in advance!

share|improve this question
up vote 6 down vote accepted

The only rsync options that delete files are the various --delete commands.

For your purpose, you may be interested in other options as well, such as --ignore-existing.

If you are ever unsure what will be updated during a run, always do a dry run (-n) first.

share|improve this answer
+1 for --dry-run. Very useful for making sure you haven't slipped up with the --delete* options. – David Spillett Aug 31 '09 at 19:53
Here here for dry run plus one! (re-reading that it sounds too cheesy!) ;-) – ForgeMan Aug 31 '09 at 21:01

The -a option in rsync's behaviour does not include any of the "delete" options (see the man page (man rsync) for a list if the options it does include) and -z just ass compression (like the --compress long-name option). So rsync -az should not delete anything at either the client or server end.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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