[lxc-users] What is right way to backup and restore linux containers?
John Lewis
oflameo2 at gmail.com
Sat Dec 5 12:10:52 UTC 2015
What I do is store my containers in a disk image with a filesystem,
usually ext4. I store the image in the LXC server's /opt. I mount the
LXC's to /srv before starting them because I haven't figured out how to
run them directly out of the disk images yet. I back up the disk images
with rsnapshot with a sparse option. It saves a lot of time because
there is only one file to backup instead of hundreds for each LXC.
To restore I mount the disk image and rsync the target file back to the
original container or copy up the whole container disk image over the
one that wasn't in the the state I needed it to be in. To back up
databases, you need to make sure you get a database dump before the
backup. The way I like to do it is by using a remote ssh command and
dump the database over an ssh socket from the backup machine, I copy the
dump command up using standard input and copy the database dump back
down using standard output. Keeping database files on a separate image
file is helpful to reduce the size of backups but not required.
On 12/04/2015 11:32 AM, Saint Michael wrote:
> I was going t ask the same question.
> It is a very important one. I am moving containers via rsync, but it
> takes tooo long.
>
> On Fri, Dec 4, 2015 at 11:03 AM, Eax Melanhovich <afiskon at devzen.ru
> <mailto:afiskon at devzen.ru>> wrote:
>
> Hello.
>
> Lets say I have some container. I would like to run something like:
>
> lxc-backup -n test-container my-backup.tgz
>
> Then move backup somewhere (say, to Amazon S3). Then say I would like
> to restore my container or create its copy on different machine. So I
> need something like:
>
> lxc-restore -n copy-of-container my-backup.tgz
>
> I discovered lxc-snapshot, but it doesn't do exactly what I need.
>
> So what is the right way of backuping and restoring linux containers?
>
> --
> Best regards,
> Eax Melanhovich
> http://eax.me/
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> <mailto:lxc-users at lists.linuxcontainers.org>
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
>
>
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20151205/cb832c4c/attachment.html>
More information about the lxc-users
mailing list