1. Overview
Remote Sync (rsync) is a utility for copying and synchronizing files and directories across networked systems.
When using rsync, we may want to have the option to ignore specific file properties (like ownership, modification time, group, and permissions) when copying files. In this tutorial, we’ll learn how to add particular options to rsync to make it ignore several file properties.
2. Ignoring File Properties
When adding archive mode (-a) to rsync, we tell rsync that we want recursion and want to preserve almost everything (excluding hard links).
However, if we want to exclude more file properties, we can specify them using the –no-OPTION switches:
$ rsync -a --no-OPTION [source files and directories] [destination]
We can specify the –no-OPTION property as:
- –no-links to ignore symbolic links
- –no-perms to ignore permissions
- –no-times to ignore modification times
- –no-group to ignore groups
- –no-owner to ignore ownership
- –no-devices to ignore device files
For example, the following command will copy file1.txt to /home/user/Downloads/Temp, but it’ll ignore its group:
$ rsync -a --no-group file1.txt /home/user/Downloads/Temp/
3. Conclusion
In this short tutorial, we learned how to add particular options to rsync to make it ignore specific file properties.