Backup generation policy

Objective:
Establish a clear policy to generate regular backups of the operating system and data of virtual machines.

Procedure:

  1. OS copies with Vagrant:
    With Vagrant, machines can be easily recreated from the configuration saved in the Vagrantfile, so it is not necessary to make full copies of the operating system. However, it is important to have the box of Vagrant available to quickly recreate any machine.
  2. Data copies with rsync:
    Apart from the configuration of the operating system, the data can be protected by scheduled backups with rsync. These files can be copied from the virtual machine to the external hard drive, NAS or to a backup server.
Script examples:
 #!/bin/bash
  1. SOURCE_DIR="/home/user/data/"
  2. BACKUP_DIR="/home/usuari/backups/"
  3. rsync -avz $SOURCE_DIR $BACKUP_DIR

Automation of backups:
To ensure that backups are made on a regular basis, it can be used cron to run the script automatically. This ensures that files are backed up without the need for manual intervention.

Example cron job:

Automation of backups:
To ensure that backups are made on a regular basis, it can be used cron to run the script automatically. This ensures that files are backed up without the need for manual intervention.

Example cron job:

0 2 * * * /home/usuari/backup.sh

Backup storage:

Data backups can be stored in a local folder or an external server, such as a NAS, to ensure that information is protected in the event of a virtual machine failure.

Esta web utiliza cookies propias y de terceros para su correcto funcionamiento y para fines analíticos. Contiene enlaces a sitios web de terceros con políticas de privacidad ajenas que podrás aceptar o no cuando accedas a ellos. Al hacer clic en el botón Aceptar, acepta el uso de estas tecnologías y el procesamiento de tus datos para estos propósitos.
Privacidad