Backup storage


Introduction

OVH provide free backup storage for all of its dedicated servers. This guide explains how to activate that feature and how to use it.

The OVH backup storage is accessible via these popular protocols:

  • FTPS
  • FTP
  • NFS
  • CIFS

The access is restricted by IP using ACL. You can create a ACL for the IPs that are on your server via the manager or the API. By default, all IPs in your account have FTP/FTPS access to the backup storage. The other protocols are not authorized by default. To authorize them you have to create a ACL.

Activation

To activate the backup storage;

  1. Log into your Manager
  2. Select your server in the Infrastructures tab
  3. Select the Backup storage tab
  4. Click the Activate the Backup Storage button
_images/services-backup-storage-activate.png

Activating Backup Storage

  1. Click Confirm
_images/services-backup-storage-activate-confirm.png

Confirm Backup Storage activation

  1. You should see a confirmation message and receive an activation email
_images/services-backup-storage-activate-done.png

Activation completed

Usage summary

  1. Log into your Manager
  2. Select your server in the Infrastructures tab
  3. Select the Backup storage tab
_images/services-backup-storage-usage.png

Backup storage usage summary

There you will see the amount of space used versus the amount of space available in your backup storage.

Reset password

Backup storage passwords are generated automatically, for security reasons you cannot specify your own password.

If you lost your password, you can generate a new one using this procedure:

  1. Go in your Manager
  2. Select your server in the Infrastructures tab
  3. Select the Backup storage tab
  4. Click the Forgotten password? button
_images/services-backup-storage-reset-password.png

Reset password

  1. Click the Confirm button
_images/services-backup-storage-reset-password-confirm.png

Reset password confirmation

  1. You should now see this message and receive an email with the new password
_images/services-backup-storage-reset-password-done.png

Reset password completed

ACL Management

To authorize IPs on your backup storage you need to create an ACL and allow a connection protocol for that IP.

The ACL management can be done at two places, either with the Manager or with the API.

Via the Manager

Adding a new access

To authorize an IP to a backup storage using the Manager:

  1. Log into your Manager
  2. Select your server in the Infrastructures tab
  3. Select the Backup storage tab
  4. If the IP is not in the list click the Add an access button
_images/services-backup-storage-access-add.png

Add access

  1. Select the IP or block you want to autorize
_images/services-backup-storage-access-select.png

Add access

  1. Confirm your selection
_images/services-backup-storage-access-confirm.png

Add access

  1. You should see a confirmation message
_images/services-backup-storage-access-done.png

Add access

Modifying an existing access

To modify an existing access:

  1. Click on the “cog” in the last column and then on “Modify the access”.
_images/services-backup-storage-access-modify.png

Modify access

  1. Select the protocols you want to authorize for this IP or block:
_images/services-backup-storage-access-modify-select.png

Select protocols to add or remove for an IP

  1. You should see a confirmation message;
_images/services-backup-storage-access-modify-done.png

Modify access

Deleting an access

To delete an access:

  1. Click on the “cog” in the last column and then on “Delete the access”.
_images/services-backup-storage-access-modify.png

Delete an access

  1. Select the protocols you want to authorize for this IP or block:
_images/services-backup-storage-delete-confirm.png

Delete confirmation

  1. You should see a confirmation message;
_images/services-backup-storage-delete-done.png

Access deleted

Deleting a backup storage

  1. Log into your Manager
  2. Select your server in the Infrastructures tab
  3. Select the Backup storage tab
  4. Click the Delete Backup Storage button
_images/services-backup-storage-delete-backup.png

Delete backup storage

Danger

This operation is non-reversible, all data is permanently destroyed!

Using the backup storage

The backup storage service does not automatically backup your data, it only provide the space and the access protocols. It is your responsibility to implement an adequate backup strategy using the tools of your choice.

FTP/FTPS

Linux

ncftp

Note

This command does not support the FTPS protocole. If you need secure transfer you should use lftp or curl instead.

To save individual files you can use the following command:

ncftpput -uFTPUSER -pFTPPASS FTPBACKUPHOST /REMOTE/FOLDER /FILE/TO/SAVE

Replace the following variables with the correct information:

FTPUSER:The FTP username
FTPPASS:The FTP password
FTPBACKUPHOST:The hostname of the backup server
/FILE/TO/SAVE:The local file to upload
/REMOTE/FOLDER:The remote target directory where to save the file

To backup a folder, simply create an archive before uploading it:

tar czf - /DIRTOSAVE | ncftpput -uFTPUSER -pFTPPASS -c FTPBACKUPHOST DIRNAME.tar.gz
DIRTOSAVE:The name of the directory you want to put in the archive
FTPUSER:The FTP username
FTPPASS:The FTP password
FTPBACKUPHOST:The hostname of the backup server
DIRNAME:The name of the directory you want to upload

To download an archive file from your backup storage, you can use the following command:

ncftpget -v -u FTPUSER -p FTPPASS FTPBACKUPHOST /LOCALDIR /FILEBACKUP
FTPUSER:The FTP username
FTPPASS:The FTP password
FTPBACKUPHOST:The hostname of the backup server
LOCALDIR:The local target directory where to save the file
FILEBACKUP:The path to the file you want to download
Curl

Note

To use FTPS you must change the hostname of the backup storage. For example, if the name of your backup storage is ftpback-bhsX-YYY.ip-Z.Z.Z.Z.net, you need to change it for ftpback-bhsX-YYY.mybackup.ovh.ca.

You also need to add the -ssl flag to the commands below.

To backup individual files, use the following command:

curl -aT FILETOSAVE ftp://FTPUSER:FTPPASS@FTPBACKUPHOST/REMOTEDIR/
FILETOSAVE:The name of the file you want to backup
FTPUSER:The FTP username
FTPPASS:The FTP password
FTPBACKUPHOST:The hostname of the backup server
REMOTEDIR:The remote directory where the file should be uploaded

To backup a directory:

tar czf - /DIRTOSAVE | curl ftp://FTPUSER:FTPPASS@FTPBACKUPHOST/REMOTEDIR/DIRNAME-$(date +%Y%m%d%H%M).tar.gz -T -
DIRTOSAVE:Path of the directory to backup
FTPUSER:The FTP username
FTPPASS:The FTP password
FTPBACKUPHOST:The hostname of the backup server
REMOTEDIR:The remote directory where the file should be uploaded
DIRNAME:The name of the directory to backup

To download an archive from you backup storage you can use the following command:

cd /LOCALDIR
curl -u FTPUSER:FTPPASS ftp://FTPBACKUPHOST/FILEBACKUP
FTPUSER:The FTP username
FTPPASS:The FTP password
FTPBACKUPHOST:The hostname of the backup server
LOCALDIR:The local directory where to save the file
FILEBACKUP:Full path of the archive to download
lftp

Note

lftp use FTP+SSL/TLS by default. So you must change the hostname of the backup storage. For example, if the name of your backup storage is ftpback-bhsX-YYY.ip-Z.Z.Z.Z.net, you need to change it for ftpback-bhsX-YYY.mybackup.ovh.ca.

To backup individual file use the following command:

lftp ftp://username:password@ftpback-bhsX-YYY.mybackup.ovh.ca:21 -e "cd REMOTEDIR; put FILETOSAVE; quit"
PROTOCOL:Replace by FTP or FTPS
FTPUSER:The FTP username
FTPPASS:The FTP password
FTPBACKUPHOST:The hostname of the backup server
REMOTEDIR:The remote directory where the file should be uploaded
FILETOSAVE:Name of the file to backup

To backup a directory, use the following command:

tar czf - /DIRTOSAVE | ftp://username:password@ftpback-bhsX-YYY.mybackup.ovh.ca:21 -e "cd REMOTEDIR; put /dev/stdin -o DIRNAME-$(date +%Y%m%d%H%M).tar.gz;quit"
PROTOCOL:Replace by FTP or FTPS
DIRTOSAVE:Full path of the directory to backup
FTPUSER:The FTP username
FTPPASS:The FTP password
FTPBACKUPHOST:The hostname of the backup server
REMOTEDIR:The remote directory where the file should be uploaded
DIRNAME:The name of the directory to backup

To retrieve a file from the backup storage, use the following command:

cd /LOCALDIR
lftp ftp://username:password@ftpback-bhsX-YYY.mybackup.ovh.ca:21 -e "get /FILEBACKUP; quit"
PROTOCOL:Replace by FTP or FTPS
FTPUSER:The FTP username
FTPPASS:The FTP password
FTPBACKUPHOST:The hostname of the backup server
LOCALDIR:The local directory where to save the file
FILEBACKUP:Full path of the archive to download

Windows

Filezilla
  1. Connect to your server using Remote Desktop.
  2. Open the Internet browser and download FileZilla. (When asked, it is not necessary to install complementary software)
  3. Launch FileZilla and use the FTP credentials you received by email
host:The host of the backup storage
user:The username of your backup storage
password:The password of your backup storage
  1. Click Quickconnect

Note

The left pane shows the local content of your server, the right pane shows the content of your backup storage. You can drag and drop files from one pane to another to upload or download file from your backup storage.

NFS

Note

The NFS protocol is for use with Linux distributions. For Windows you should use CIFS or FTP.

First make sure you added the necessary ACLs to allow NFS protocol with the IP you want to use. If you did not, please refer to the ACL Management section.

Depending on your distribution, you might have to install the NFS client and start the NFS/portmap services.

Once you have the NFS client installed and portmap running, you can mount the NFS share like a normal partition:

mount -t nfs FTPBACKUPHOST:/export/ftpbackup/SERVICENAME /DOSSIERMOUNT
FTPBACKUPHOST:The host of the backup storage
SERVICENAME:The name of your server (ex: ns0000000.ip-123-123-123.net)
DOSSIERMOUNT:The folder where you want to mount the NFS share

Once the share is mounted, you can use commands like cp and rsync like on a normal directory.

CIFS

First make sure you added the necessary ACLs to allow CIFS protocol with the IP you want to use. If you did not, please refer to the ACL Management section.

Windows

Open the command prompt and type the following command:

net use z: \\FTPBACKUPHOST\SERVICENAME
FTPBACKUPHOST:The host of the backup storage
SERVICENAME:The name of your server (ex: ns0000000.ip-123-123-123.net)

Once completed, you should now have a new Z: drive that you can use like a normal mounted share.

Linux

Use SSH to connect to your server and type the following command:

mount -t cifs -o sec=ntlm,uid=root,gid=100,dir_mode=0700,username=root,password= //FTPBACKUPHOST/SERVICENAME /mnt/DIRNAME
FTPBACKUPHOST:The host of the backup storage
SERVICENAME:The name of your server (ex: ns0000000.ip-123-123-123.net)
DIRNAME:Directory name where to mount the share (it must exists!)