Remote backup through Azure Blobs

Assumptions

To proceed with the community, it is necessary to ensure these steps:"

  • Create an Azure blob;
  • Gather remote partition mounting information through the CIFS protocol.

1. After creating the Azure blob, Azure will provide the following information for creating the remote CIFS partition:

sudo mkdir /mnt/senhaseguralab
if [ ! -d “/etc/smbcredentials” ]; then
sudo mkdir /etc/smbcredentials
fi

if [ ! -f “/etc/smbcredentials/storage-blob-senhasegura.cred” ]; then
sudo bash -c ‘echo “username=storage-blob-senhasegura” >> /etc/smbcredentials/storage-blob-senhasegura.cred’
sudo bash -c ‘echo “password=gGqzp0aJsIT9bl3kHvLkYadp6t+RFU86EfNGkHkxTtCoM36+AStqt69Zg==” >> /etc/smbcredentials/storage-blob-senhasegura.cred’
fi

sudo chmod 600 /etc/smbcredentials/storage-blob-senhasegura.cred

sudo bash -c ‘echo “//storage-blob-senhasegura.file.core.windows.net/senhaseguralab /mnt/senhaseguralab cifs nofail,credentials=/etc/smbcredentials/storage-blob-senhasegura.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30” >> /etc/fstab’

sudo mount -t cifs //storage-blob-senhasegura.file.core.windows.net/senhaseguralab /mnt/senhaseguralab -o credentials=/etc/smbcredentials/storage-blob-senhasegura.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30

2. Based on the provided information, collect and segregate the following information from the script:

if [ ! -f “/etc/smbcredentials/storage-blob-senhasegura.cred” ]; then
sudo bash -c ‘echo “username=storage-blob-senhasegura” >> /etc/smbcredentials/storage-blob-senhasegura.cred’
sudo bash -c ‘echo “password=gGqzp0aJsIT9bl3kHvLkYadp6t+RFU86EfNGkHkxTtCoM36+AStqt69Zg==” >> /etc/smbcredentials/storage-blob-senhasegura.cred’
fi

sudo bash -c ‘echo “//storage-blob-senhasegura.file.core.windows.net/senhaseguralab /mnt/senhaseguralab cifs nofail,credentials=/etc/smbcredentials/storage-blob-senhasegura.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30” >> /etc/fstab’

3. Modify the segregated information as follows:

  • Change the credential path
  • Change the mount point to /srv/backup_remoto
  • Modify parameters in /etc/fstab
  • Add the command to mount the remote backup to the /srv partition

if [ ! -f “/root/.smbcred” ]; then
sudo bash -c ‘echo “username=storage-blob-senhasegura” >> /root/.smbcred’
sudo bash -c ‘echo “password=gGqzp0aJsIT9bl3kHvLkYadp6t+RFU86EfNGkHkxTtCoM36+AStqt69Zg==” >> /root/.smbcred’
fi

sudo bash -c ‘echo “//storage-blob-senhasegura.file.core.windows.net/senhaseguralab /srv/backup_remoto cifs nofail,credentials=/root/.smbcred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30” >> /etc/fstab’

sudo mount -vvv /srv/backup_remoto

4. After making the changes, enter the commands on senhasegura via the operating system, then validate that the partition has been successfully mounted with the following command:

df -h

The partition will be displayed as shown in the example:

5. After confirming that the remote partition has been mounted, go to Orbit → Settings → Backup and activate the system backup settings as shown in the example.

Activate application and video backups if necessary.

6. Save the actions performed.