How to preserve permissions, ownership, timestamp, archive-mode in rsync using rsync -a
rsync is a powerful file and folder synchronisation tool in linux. To read more about rsync please go through this link:
http://www.zyxware.com/articles/2717/how-to-backupcopysynchronise-a-full-folder-lying-on-a-remote-server-onto-another-localremote-machine-easily-using-
'rsync -a' option preserves the permissions, ownership, timestamp of files and folders that are to be rsynced. To rsync a file or folder from source to destination usually we use the format:
rsync source destination
Inorder to preserve the above mentioned permissions, ownership and timestamp use the command:
rsync -avz source destination
This will synchronize the two folders or files and also maintain the same timestamp as that of source. To test whether this has been done right you can check the permission of files in folder in source destination using 'ls -al' command.