[lxc-users] Online container backup

Fajar A. Nugraha list at fajar.net
Thu Jun 11 06:58:41 UTC 2015


On Thu, Jun 11, 2015 at 1:51 PM, Narcis Garcia <informatica at actiu.net>
wrote:

> Debian 8 in a single and tratitional ext4 partition.
> My idea is that the backup is a complete container export, to be
> restored in another box if necessary.
>
>

I highly recommend you switch to btrfs or zfs (I use zfs)



> Is there some newer LXC repository for Debian as ppa:ubuntu-lxc/daily ?
>


You have to ask debian folks for that. AFAIK building from source should
give you the same functionality though.


>
> At this moment, my procedure is:
> $ lxc-stop -n MyGuest
> $ tar -cjf /var/backups/MyGuest.tar.bz2 /var/lib/lxc/MyGuest
> $ lxc-start -n MyGuest
> but container unavailability is too long.
>

exactly. With zfs it's simply "zfs snapshot data/lxc/guest at backup-1", which
often takes less than 1 second (and it doesn't block container IO)


>
> Another procedure, but without stopping container:
> $ cp -aPx /var/lib/lxc/MyGuest /tmp/MyGuest
> $ tar -cjf /var/backups/MyGuest.tar.bz2 /tmp/MyGuest
>


Dangerous. If you have mysql (or another db) running on the container, you
may be unable to start the it from backup later due to it complaining being
corrupt.

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150611/3bd05f10/attachment.html>


More information about the lxc-users mailing list