Backup using rsync command

Not sure if I am posting this is correct subsection or not, please point me in right direction if I am not. I ran across this the other day and trying to learn a little more about it. Customer site had a couple of SuSE10 servers with OES2 addon and I migrated all of their servers to SuSE11/OES11. The had a NAS device setup and was using a script file to run a nightly backup to it. The script would mount the NAS share that was created and used the following command to copy the data to it:

rsync -ahz --delete-after source target

Now, I am not that familiar with this command but customer wanted me to replicate the command over to the new servers, so I copy the scripts over, modify permissions and the script itself for the new data locations and set them up in cron to run. Seems to work fine but would like to know a little more about the rsync and what those options are doing. I have read through some articles online about the command but can’t find anything specifically using this format. I believe the delete-after portion deletes files on the target if the source file is no longer there. Not sure exactly what the -ahz is doing for sure though. Appreciate any clarification you can give.

From the rsync manpage:

-delete-after receiver deletes after transfer, not during
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
-h, --human-readable output numbers in a human-readable format
-z, --compress compress file data during the transfer


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Thanks for the info. It appears it can be run, or at least I see allot of posts running it this way, without the h option on there but with -avz option. Going to decide which option is best.

Hi jlewter,

that’s purely cosmetics - verbose information and or human-readable numbers (instead of large octett/block numbers). Anyone ever looking at those mails from cron? If not, drop -v to keep the mail spool small :wink:

Regards,
Jens

No, currently running it with the -ahz format. Just curious about the v option, but don’t need all that info. Guess I don’t need the h option as well.