Linux Server Backups using HiDrive Pro

In this guide we will configure a nightly server backup running Bitnami with HiDrive Pro for FTP storage.

Please note that only HiDrive Pro supports FTP access. Lower tariffs will not work with this setup:

Before we get started login to your HiDrive Pro account at

Go to Settings > Account. Under “Access rights and protocols” click the edit button and uncheck the “Only use encrypted connections” button.

Now firstly you will want to login to your server using SSH and create the following folders: /scripts and /tmpbackup

Now proceed with the steps below:

First create /scripts/ with the following code:

/opt/bitnami/ stop
/bin/zip -r /backup/$(date +\%Y-\%m-\%d).zip /opt/bitnami
/opt/bitnami/ start

This code will stop your web services and then create and store a backup with today’s date in /backup. It is best to stop web services while this is taken to ensure no data is lost. Since Bitnami is self-contained the entire /opt/bitnami folder is backed up. These folders can be adjusted accordingly if your data is stored elsewhere.

Next create your 2nd script at /scripts/ with the following code:

cd /backup
ftp -n -i $SERVER <<EOF
mput *.zip
cd /backup
rm -rf *.zip

This code connects to your ftp storage on HiDrive and transfers the backup previously run. Once the transfer completes it then deletes the backup from your server’s local storage.

Next make sure to give needed execute privileges to your new scripts:

chmod +x /myscripts/*

To complete the automated backup process we will now configure a cronjob for each script:

crontab -e

0 2 * * * /myscripts/
0 3 * * * /myscripts/

This will have each script run daily at 2am and 3am. A delay is put in for the ftp transfer to ensure the previous archive process completes before the transfer starts. This is more of a personal preference as this could be combined into a single script. I prefer it this way as to spread out the load on the server as will stress the CPU and Disk I/O while will cause load on the Network.

Marv has written 28 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>