Skip to content

Instantly share code, notes, and snippets.

@protrolium
Last active December 24, 2023 19:05
Show Gist options
  • Save protrolium/ca297adea239348dff0a to your computer and use it in GitHub Desktop.
Save protrolium/ca297adea239348dff0a to your computer and use it in GitHub Desktop.
rsync methods

using rsync

$ rsync -avE --progress /source/ /destination

  • -v --verbose
  • -a --archive (preserve all attributes)
  • -n --dry-run
  • -E, --executability (preserve executability)
  • --delete This tells rsync to delete extraneous files from the receiving side (files that aren't on the sending side), but only for the directories that are being synchronized.

trailing slash after source/ means copy contents inside names folder. without trailing slash it copies the folder itself

use flag --dry-run before executing

exclude directories using curly brackets: --exclude={.ccache,build}

building from a list of directories

$ rsync -avr --files-from=/path/to/list.txt / /path/to/destination/

if full paths are given in list, use / for the source directory. use -r recursive option to seek for sub-directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment