Skip to content

Instantly share code, notes, and snippets.

@crosstyan
Forked from kalaksi/rsync-rootfs.md
Created April 8, 2024 04:46
Show Gist options
  • Save crosstyan/3b52d3c3d7a3b802adc2d75123240385 to your computer and use it in GitHub Desktop.
Save crosstyan/3b52d3c3d7a3b802adc2d75123240385 to your computer and use it in GitHub Desktop.
Copy the whole root filesystem excluding pseudo-filesystems and mountpoints

Copying the whole linux root filesystem locally or remotely using rsync

Explanation of chosen options:

  • Verbose output with speed and progress information
  • Try to preserve all possible information: file attrs, hardlinks, ACLs and extended attrs,
  • Exclude contents of pseudo-filesystems and mountpoints
  • In this example source host is remote and destination local.
rsync --info=progress2  -vaHAX --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} source.host:/ /local/destination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment