Rsync is very powerful, here are the parameters I used to do a directory backup with rsync:
rsync -ruPi -plEt /home/op/photo/ /remote_backup/photo/ --dry-run
-R Loop Directory
-U update mode, synchronizing only the updated
-P equals--partial--progress, shows Progress, and supports breakpoint continuation
-I displays the synchronization details for each file, see the--itemize-changes section below
-P Reserved Permissions
-L Copy Soft link (if you want to copy the actual file that the link points to, use-l)
-E Reserved Execution permissions
-T retention modification time
--delete Sync Delete action
Where-I displays the synchronization details for each file, see the--itemize-changes section below
The following transfer is from: StackOverflow
Explanation of each bit position and value in rsync ' s output:
Yxcstpoguax path/to/file| | | | | | | | | | | | | | | | | | | | | | ╰-X:the extended attribute Information changed| | | | | | | | | ╰--a:the ACL Information changed| | | | | | | | ╰---u:the u slot is reserved for the future use| | | | | | | ╰----G:group is different| | | | | | ╰-----O:owner is different| | | | | ╰------p:permission is different| | | | ╰-------t:modification time is different| | | ╰--------S:size is different| | ╰---------C:different Checksum (for regular files), or| | Changed value (for symlinks, devices, and special files) |╰----------The file type:| f:for a file,| D:for a directory,| L:for a symlink,| D:for a device,| S:for a special file (e.g. named sockets and FIFOs) ╰-----------The type of update being done:: <: File is Being transferred to the remote host (sent);: file was being transferred to the local host (Received) C:local change/creation for the item, such as:-The creation of aDirectory-the Changing of a symlink,-etc. H:the item is a hard link to another item (requires--hard-links). .: The item is not being updated (though it might has attributes that is being modified) *: M EANs the rest of the Itemized-output area contains a message (e.g. "deleting")
Some example output from Rsync for various scenarios:
>f+++++++++ some/dir/new-file.txt.f....og..x some/dir/existing-file-with-changed-owner-and-group.txt.f........x some/dir/existing-file-with-changed-unnamed-attribute.txt>f...p....x some/dir/existing-file-with-changed-permissions.txt>f..t..g..x some/dir/existing-file-with-changed-time-and-group.txt>f.s......x some/dir/existing-file-with-changed-size.txt>f.st.....x some/dir/existing-file-with-changed-size-and-time-stamp.txt cd+++++++++ some/dir/new-directory/.d....og... some/dir/existing-directory-with-changed-owner-and-group/.d..t...... some/dir/existing-directory-with-different-time-stamp/
Rsync incremental Sync flag bit detailed explanation