I recently replaced my IPCop firewall computer and had a perfect chance to test my backups. I like to customize my IPCop install so I have the Advanced Proxy, URL Filter, Update Accelerator, Block out Traffic, ntop, Zerina (OpenVPN), Firewall Logs (Pie Charts for Firewall Information), Guardian, and sometimes CopFilter addons installed. The backup feature that comes with the IPCop doesn’t include all the addons when you create a backup. So I wrote me a little script, scheduled it once a week, and have it rsync’d to a backup server.

I always keep downloaded addons in /root/Addons. Always! That way I know what version was installed and its included in the backup so when I restore I reinstall the same version for the config files stored in /var/ipcop.

/root/backup.sh:


#!/bin/bash
echo Starting backup process...

if [ -f /root/backup.tar.gz ]
then
        rm /root/backup.tar.gz
fi

# This should grab all settings. Addons will need to be reinstalled.
tar zcvf /root/backup.tar.gz \
/var/ipcop \
/root/Addons \
/root/backup.sh \
/var/log/rrd \
/var/log/logwatch \
--absolute-names \
--exclude /var/ipcop/ethernet/settings

rsync -vu /root/backup.tar.gz "[IP.OF.BACKUP.SERVER]::IPCOP/" --progress &

# Notes
# Be sure to add the backup script to the new systems crontab
# fcrontab -e
# Add "0 1 * * 6 /root/backup.sh"

When I went to replace my box I reinstalled IPCop 1.4.20 on it. I setup my networking just as I had before. I specifically exclude the /var/ipcop/ethernet/settings file because it also tells the system what network card to use. Since this is a new box with different network cards I don’t want any confusion. I then transfer, usually using WinSCP, the backup.tar.gz to the new system from the backup server. I always keep the file in /root. You will need to turn on SSH access from the IPCop GUI to remote into the system to extract the backup and install the addons.

At this point I reinstall all the addons from the /root/Addon folder. Each having their own instructions, refer to the documentation for each addon. Another post perhaps?

Restore the backup:


tar zxvf /root/backup.tar.gz -C /

Restart the system and you should be up and running.