User Tools

Site Tools


burim:bash:lxc-backup
Shutdown the container

# lxc-stop -n $NAME
Archive container rootfs & config

# cd /var/lib/lxc/$NAME/

# tar --numeric-owner -czvf container_fs.tar.gz ./*

# rsync -avh container_fs.tar.gz user@newserver:/var/lib/lxc/

Extract rootfs
# mkdir /var/lib/lxc/$NAME/
# cd /var/lib/lxc/$NAME/
# tar --numeric-owner -xzvf container_fs.tar.gz .

https://stackoverflow.com/questions/23427129/how-do-i-backup-move-lxc-containers

burim/bash/lxc-backup.txt · Last modified: 2022/10/30 20:22 by burim

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki