# rm-rf.es

Backups en Virtuozzo 4.6 con vzabackup / vzarestore

vzabackup y vzarestore son las utilidades designadas a la gestión de copias de seguridad tanto para nodos Hardware y máquinas virtuales Virtuozzo.

vzabackup

vzabackup permite hacer copia de seguridad tanto del propio nodo Hardware como de uno, varios o todos los contenedores del mismo. También permite hacer backups de nodos remotos. A continuación podéis ver todas las opciones disponibles:

vzabackup [BACKUP OPTIONS...] NODE1 ... [CT OPTIONS...]

[BACKUP OPTIONS]
-F, -I, --Tfull
	Create a full backup.
-i, --Tinc
	Make an incremental backup or, if no full backups are available, a full backup.
--Tdiff
	Make a differential backup or, if no full backups are available, a full backup
-o,--rm-old
	Create a backup and then remove the oldest backups.
-d,--rm-tag
	Create a backup and then remove the backup with the
	specified backupID. You can learn the backup IDs of the
-J
	Do backing up nodes simultaneously if more than one source node specified.
--force
	Don't stop on errors during backup of Container. Should be used when more than
	one Container's specified to backup.
--view-folder
	 Show current backup storage configuration.
--set-folder-creds [USER[:PASSWORD]]
	 Set backup storage login credentials.
--backup-folder-path PATH
	Path to a custom backup storage location.
--backup-folder-login USER
	Username for a custom backup storage on a samba share.
--backup-folder-passwd PASSWORD
	Password for a custom backup storage on a samba share.
--set-folder
	Use --backup-folder-* options values to change backup storage configuration.
-D DESCRIPTION
	Set backup description.
-C
	Set compression level in range from 0 to 3.
--storage [USER[:PASSWD]]@ADDRESS
	Set address and credentials for storage server, where backup is stored.
NODE
	NODE parameter specifies the node to be backed up.

	 Node should be specified in format: [USER[:PASSWD]]@ADDRESS.

[CT OPTIONS]
-e
	List of Containers to backing up. Back up all the Containers if omitted.
-x
	List of Containers to skip. Do not skip any Containers if omitted.
--include-files
	Paths(files) to include in backups.
--exclude-files
	Paths(files) to exclude from backups.

Vamos a hacer un ejemplo práctico en el que queremos hacer una copia de seguridad de todos los contenedores del nodo Hardware local en la ruta /backup (en este caso una unidad montada por NFS):

# vzabackup --backup-folder-path /backup -i localhost

Con -i indicamos que queremos hacer backups incrementales y con «localhost» que son para el nodo local. Si quisieramos hacerlo en un storage remoto y de un nodo remoto sería así:

# vzabackup  --storage root:password@192.168.0.100 root:password_remoto@192.168.0.111

Si quisieramos hacerlo únicamente del contenedor 101:

# vzabackup --backup-folder-path /backup -i localhost -e 101

El resto es jugar con las opciones, la compresión, el tipo de backup, etc. A la hora de hacer backups de servidores remotos hay que asegurarse que la conectividad SSH es satisfactoria y que pueden comunicarse mediante llave SSH.

vzarestore

Lo primero que debemos saber de vzarestore es que permite mostrar un listado de los backups disponibles en el nodo seleccionado. Si quisieramos ver los backups disponibles en el nodo local y en la ruta /backup:

# vzarestore --list --backup-folder-path /backup
Show existing backups...
CTID    Title                   Creation date/time     Type Size
2719275 vps1                2011-04-15T111346+0002 full 213.19 Mb
305470  vps2                2011-04-15T110646+0002 full 262.13 Mb
3574391 vps3               2011-04-15T110041+0002 full 245.63 Mb
5195637 vps4               2011-04-15T111616+0002 full 710.83 Mb
8426989 vps5               2011-04-15T113722+0002 full 291.22 Mb

Para ver los backups en nodos remotos utilizaríamos el parámetro –storage:

# vzarestore --list --storage root:password_remoto@192.168.0.110

Bien, para restaurar un backup únicamente tendríamos que seleccionar su ID (CTID) y en caso de estar en una ubicación remota especificarla:

Remoto:

# vzarestore 101 --storage root:password_remoto@192.168.200.200

Local:

# vzarestore 101

En caso de contar con backups incrementales, podríamos especificar el punto de restauración con el parámetro «-b» seguido del identificador del backup (no el del contenedor). A continuación la ayuda del comando:

vzarestore is the utility to restore Container's which were backed up by means
of vzbackup. Also it can be used to remove, listing backups
and browsing contents of backups.

vzarestore [CTID[:New CTID] | -e  | -x ] [RESTORE OPTIONS] [STORAGE SERVER]
vzarestore -r, --remove  [STORAGE SERVER]
vzarestore -l,--list [LIST OPTIONS...] [STORAGE SERVER]
vzarestore --browse backupID [BROWSE OPTIONS...] [STORAGE SERVER]
vzarestore --print-ve-config BackupID [STORAGE SERVER]
vzarestore -h,--help

RESTORE OPTIONS:
-B
	Treat parameters for -e and -x options as backup ID's.
--force
	Don't stop on errors during restore of Container.
--files
	Separate files to restore, FILE is the full path to the file.
--skip-ve-config
	Do not restore Container config.
-b backupID
	Backup ID to restore files, if omitted then last backup will used.
--skip-locked
	Don't stop on errors during restore of locked files.

LIST OPTIONS
-f,--full
	Show full information (this option can be used only with --list).
--latest
	Show latest backups only (this option can be used only with --list).
-e
	List of Container's to show.
-B
	Treat parameters for -e option as backup ID's.

BROWSE OPTIONS
-d,--dir DIR
	Set the paths to the folder whose contents is to be shown.

STORAGE SERVER
--storage [USER[:PASSW]]@ADDRESS
	Set address and credentials to storage server.
	When this argument is omitted then local node will be used as storage server.
--backup-folder-path PATH
	Path to a custom backup storage location.
Salir de la versión móvil