We have updated the backup script to GNUPanel, practically is the same script that we’ve just added the ability when restoring change IP
In this article we will explain the configuration variables for the new version
The configuration file is /etc/gnupanel/gnupanel-backup.conf and has the following content
##LOG_FILE=/var/log/gnupanel-backup.sh.log ##ERR_FILE=/var/log/gnupanel-backup.sh.err LOG_FILE=/dev/stdout ERR_FILE=/dev/stderr DIRS="/etc /var/log /var/www /var/spool/squirrelmail /var/lib/squirrelmail /var/mail/correos /var/lib/mailman/archives /var/lib/mailman/data /var/lib/mailman/lists /var/lib/awstats" #UBUNTU EXTRA_DIRS="/home /root /usr/local/bin" PG_VERSION=9.1 FTP_USER=ftpuser FTP_PASSWORD=ftppassword FTP_SERVER=192.168.1.50 LOCAL_DIR_BACKUP=/var/backups/gnupanel-backups LOCAL_DIR_RESTORE=/var/backups/gnupanel-restore REMOVE_OLDER=7D VOLSIZE=100 DAY_FULL=7 DUPLICITY_GPG_PASSPHRASE=change_for_random_string DROP_LOCAL_DIR_BACKUP=no CHANGE_IP="" COMMAND_BEFORE_BACKUP="" COMMAND_AFTER_BACKUP=""
Now we will see each of the variables
LOG_FILE and ERR_FILE are to save the standard output and error output, if we want the output to be the console should use /dev/stdout and /dev/stderr
##LOG_FILE=/var/log/gnupanel-backup.sh.log ##ERR_FILE=/var/log/gnupanel-backup.sh.err LOG_FILE=/dev/stdout ERR_FILE=/dev/stderr
DIRS: are the GNUPanel directories to be backed up, should not be changed
EXTRA_DIRS: If we want to make backup other directories besides those of GNUPanel.
DIRS="/etc /var/log /var/www /var/spool/squirrelmail /var/lib/squirrelmail /var/mail/correos /var/lib/mailman/archives /var/lib/mailman/data /var/lib/mailman/lists /var/lib/awstats" #UBUNTU EXTRA_DIRS="/home /root /usr/local/bin"
PG_VERSION: The version that we have installed postgresql typically 8.1, 8.3, 8.4, 9.1
FTP_USER: FTP user
FTP_PASSWORD: FTP password
FTP_SERVER: FTP host
FTP_USER=ftpuser FTP_PASSWORD=ftppassword FTP_SERVER=192.168.1.50
LOCAL_DIR_BACKUP: Local directory where you copied the files before being uploaded to the FTP server
LOCAL_DIR_RESTORE: Local directory where you copied the files from the FTP before doing the restore.
These four parameters are for the duplicity
REMOVE_OLDER: Delete all backup sets older than the given time.
VOLSIZE: Change the volume size in Mb.
DAY_FULL: Duplicity does an incremental backup, this value indicates that day of the week do a full backup, possible values of 1, 2, 3, 4, 5, 6, 7
DUPLICITY_GPG_PASSPHRASE: Duplicity encrypts data sent to the FTP, this is the password that is used for the encryption.
REMOVE_OLDER=7D VOLSIZE=100 DAY_FULL=7 DUPLICITY_GPG_PASSPHRASE=change_for_random_string
DROP_LOCAL_DIR_BACKUP: “yes” deletes the directory LOCAL_DIR_BACKUP once uploaded to FTP.
CHANGE_IP: This variable is used when restoring, unless we change the IP must be empty and if we need to change the IP address format is as follows
In the case that the server has several IPs would be as follows
CHANGE_IP="OLD_IP1;NEW_IP1 OLD_IP2;NEW_IP2 OLD_IP3;NEW_IP3"
In case we need to run some command before and/or after performing the backup we have variables and COMMAND_AFTER_BACKUP COMMAND_BEFORE_BACKUP
This completes the article.