This article describes an alternative way to automate platform backups. To configure the backup schedule through the platform interface, see the documentation article Creating platform backups.
Example
On the server with DCImanager 6:
-
Create the script /root/dci_backup.sh:
Script option with saving the backup to a local server#!/bin/bash yes "" | dci backup > backup.log 2>&1 cat backup.log | awk -F'tar cfvz' '{print $2}' | egrep -o '[a-zA-Z0-9/_\.]+' | head -n1 rm -f backup.log
Script option with saving the backup to a local and an external server#!/bin/bash backup=$(yes "" | dci backup > backup.log 2>&1;cat backup.log | awk -F'tar cfvz' '{print $2}' | egrep -o '[a-zA-Z0-9/_\.]+' | head -n1;rm -f backup.log) rsync $backup user@domain.com:/backups/
Comments -
Make the script executable:
chmod +x /root/dci_backup.sh
-
Add the start of this script to cron:
Example of daily script start at 02:15echo "15 2 * * * /root/dci_backup.sh" | crontab
-
Restart cron:
systemctl restart crond