Various scripts for lxc container management
This script takes a snapshot of an existing container and creates a backup container from it. Due to the snapshot capability of lxc, the downtime of the original container is reduced to a minimum. A 2GB container took 30 seconds to backup. The backup container can then be easliy exported to another machine running lxc.
- checks if the container is running. If the container is running the script will stop the container.
- takes a snapshot (snap0) of the original container
- start the original container
- creates a new (backup) container from snap0
- deletes snap0
Invoke the script with lxc_backup.sh <container name>
check if the provided container name exists- update rootfs path in config file
- check if repocache is used and fix the path in config file
- TAR the backup container for easy exporting