Replicate Backup Files to a Separate Machine

If you do not want to replicate the backup files to S3, you can utilize a script provided by us to replicate the files to another Linux machine on your network. We call this machine the target machine.

On the target machine, download and run a script provided by LogicHub. The script is based on rsync.

# 1: Install rsync if it isn't already installed

# 2: Get the script from LogicHub
curl https://lhub-public.s3.amazonaws.com/scripts/lh_backup_replication.sh > lh_backup_replication.sh

# 3: Make the script executable
chmod +x lh_backup_replication.sh

# 4: Create a folder on your target machine where you want to store the replicated backup files.

# 5: Move the script lh_backup_replication.sh to a location where you want 
# to store the script on the target machine

# 6: Finally, run it. The SSH user has to be authenticated by key. It is 
#    because this operation will need to be run periodically without human intervention.
./lh_backup_replication.sh -u <ssh-username> -h <logichub-deployment-hostname> -t <target-folder-to-backup>

The first time you run this script, it will synchronize the target folder with the backup files already accumulated at /opt/logichub/backups on the LogicHub deployment.

Next, you will need to schedule periodic sync between the two machines. You can use the following instructions to set up a cron job to do it.

Schedule periodic sync between the LogicHub server and the target machine

Make sure the target machine has cron installed. You can do so with this:

$> systemctl status cron

* cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2018-10-27 02:53:20 EDT; 5 days ago

If cron is not installed, please install it using sudo yum install cron

Add the schedule in the cron service:

crontab -e

0 4 * * * ./<path-to>/lh_backup_replication.sh -u <ssh-username> -h <logichub-deployment-hostname> -t <target-folder-to-backup>

For more information on how to write cron schedules, see http://www.cronmaker.com/ and https://crontab.guru/.


© Devo Technology Inc. All Rights Reserved.