Skip to content

Instantly share code, notes, and snippets.

@erselbey
Forked from TsutomuNakamura/rsync_lxc_container.sh
Created December 23, 2019 15:32
Show Gist options
  • Save erselbey/1efd354557755a346face3b3f2f9845a to your computer and use it in GitHub Desktop.
Save erselbey/1efd354557755a346face3b3f2f9845a to your computer and use it in GitHub Desktop.
Rsync an LXC container
rsync --archive --compress --partial --append --delete --numeric-ids \
--exclude=/rootfs/cdrom/* --exclude=/rootfs/dev/* --exclude=/rootfs/media/* --exclude=rootfs/mnt/* \
--exclude=/rootfs/proc/* --exclude=/rootfs/run/* --exclude=/rootfs/sys/* --exclude=/rootfs/tmp/* \
/var/lib/lxc/${container}/ user@desthost:/var/lib/lxc/${container}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment