[Users] backup ploop

Kevin Holly [Fusl] openvz at lists.dedilink.eu
Thu Sep 11 16:32:02 PDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On 09/12/2014 01:05 AM, Nick Knutov wrote:
> How to backup ploop CT's using and not using snapshots if
> 
> 1) I do not need the state of running processes, only files 2) But
> I have mysql on some CTs and some files can be broken if they are 
> not synced/closed 3) Backup must be without downtime, I can't stop
> CT && make backup && run CT
> 

Maybe that's something for you (code is untested but *should* work)?

# define the container id
CTID=100

# copy any files in /vz/private/$CTID/ away but exclude file
/vz/private/$CTID/root.hdd/root.hdd
rsync ...

# remove all existing snapshots for this container (just to be sure
that the previous backup process did not crash)
for snapid in $(vzctl snapshot-list $CTID -HoUUID); do vzctl
snapshot-delete $CTID --id $snapid; done

# exec any necessary commands inside container BEFORE snapshot
vzctl exec $CTID '<run command to flush mysql onto the disk and
disable disk write access (write to memory for now)>'

# snapshot the container
vzctl snapshot $CTID --skip-suspend

# exec any necessary commands inside container AFTER snapshot
vzctl exec $CTID '<run command to flush mysql onto the disk and enable
disk write access again>'

# copy your /vz/private/$CTID/root.hdd/root.hdd file
rsync ...

# remove all existing snapshots for this container after we're done
for snapid in $(vzctl snapshot-list $CTID -HoUUID); do vzctl
snapshot-delete $CTID --id $snapid; done

- -- 
Best regards

Kevin Holly - root at hallowe.lt - http://hallowe.lt/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBAgAGBQJUEjDyAAoJELAaqP3QtzpMDk4H/i2gZv81MtVVjVaw0y11muf2
akbhWmqmnfzusj0TzLFDijKTjlVaIxoQuiFNEbXYHr8iDALUMxLpJivUcCfbqxS7
4Tm73Jy+0Csmjsvyt71Kj4J+Oqb8EN8A4QO+MFWzvSH61Kl67ja+6r/Prl0RM+9K
028Q3jPn9P/mrt9oHseehDgnCICn+JGHTwtIS01DFIJZKE5pAoCZg4Q1AfWA7UEO
cV80Q7yd9C5D+iAsmxWL1Zj1uaXJvB36mz2QUDgqJ+LXlhKWPwpr36Lnjjp64Up0
S03tW4EWgL4AurWIKEZbLkVVtAqanz3JFvhDXbN1R2Hx14UGVc0eggiga6LWFvY=
=4qJO
-----END PGP SIGNATURE-----


More information about the Users mailing list