Rocky 9.x rsync copy files with paths mentioned in a text file
From Notes_Wiki
Revision as of 04:22, 10 April 2024 by Saurabh (talk | contribs) (Created page with "Home > Rocky Linux or CentOS > Rocky Linux 9.x > Rocky 9.x Backup Tools > Rocky 9.x rsync > Rocky 9.x rsync copy files with paths mentioned in a text file If we need to rsync only specific files and not all sub-folders and files and the path of files to be synced in captured in a text file then we can use following rsync syntax: <pre> rsync -av --files-from=yourfilelist.txt /sourcedirectory/ /destination/ </pre> Here, because of use of...")
Home > Rocky Linux or CentOS > Rocky Linux 9.x > Rocky 9.x Backup Tools > Rocky 9.x rsync > Rocky 9.x rsync copy files with paths mentioned in a text file
If we need to rsync only specific files and not all sub-folders and files and the path of files to be synced in captured in a text file then we can use following rsync syntax:
rsync -av --files-from=yourfilelist.txt /sourcedirectory/ /destination/
Here, because of use of --files-from only these files from /sourcedirectory/ get synced to same relative path in /destination/ folder.
Refer:
- https://unix.stackexchange.com/questions/174674/rsync-a-list-of-directories-with-absolute-path-in-text-file
- https://stackoverflow.com/questions/16647476/how-to-rsync-only-a-specific-list-of-files
- https://serverfault.com/questions/212439/linux-mv-or-cp-specific-files-from-a-text-list-of-files
- https://phoenixnap.com/kb/rsync-exclude-files-and-directories
- https://documentation.suse.com/sles/15-SP5/html/SLES-all/cha-net-rsync.html
Home > Rocky Linux or CentOS > Rocky Linux 9.x > Rocky 9.x Backup Tools > Rocky 9.x rsync > Rocky 9.x rsync copy files with paths mentioned in a text file