Monday, March 28, 2011

How to configure Backuppc to automatically backup Smoothwall firewall

I decided it was time to get all my machines on the same backup solution. I've been using Backuppc for quite awhile for my Windows boxes, but have been slower to move my Linux machines over. I really was challenged when I tried to backup my smoothwall firewall for my home network How difficult could it be. It's on a linux based operating system.

At first I had issues with tar exited with error 65280 () status. All my troubleshooting seemed to point to a permissions error. Ultimately, the process below would have saved me a lot of troubleshooting and on the job learning.

1. Setup SSH public credentials between both machines (see http://backuppc.sourceforge.net/faq/ssh.html OpenSSH section), so the user that BackupPC runs under can get the proper credentials to connect to the Smoothwall server, without physically typing in a password.

2. Modify the client transfer configuration for the non-standard tar location and SSH port on Smoothwall.

  1. Tar Paths/Commands - TarClientPath /usr/bin/tar
  2. Tar Paths/Commands - TarClientCmd $sshPath -p 222 -q -x -n -l root $host env LC_ALL=C $tarPath -c -v -f - -C $shareName+ --totals
  3. Tar Paths/Commands - TarClientRestoreCmd $sshPath -p222 -q -x -l root $host env LC_ALL=C $tarPath -x -p --numeric-owner --same-owner -v -f - -C $shareName+

3. Login as backppc user on the Backuppc server (or su to that account) and connect to the Smoothwall client. Accept the certificate. While your here you may want to look at the command that Backuppc server is trying to run against the Smoothwall (check XferLOG in Backuppc for the Smoothwall client). I found removing the -q option in the string very helpful for troubleshooting. Removing it allows error messages to be sent to the console.

4. Backup all the smoothwall directories -except the /proc

The good news is now I have automatic and periodic backups of my firewall configuration. Several incremental and full backups. Now Smoothwall upgrades are less stressful. I have backups (beyond a floppy disk), just in case a modification I've made to the Smoothwall firewall gets clobbered by an update.

Hope this helps someone else with the issue. If you have any tips on something I missed -let me know.

References:
http://www.backupcentral.com/phpBB2/two-way-mirrors-of-external-mailing-lists-3/backuppc-21/tar-backup-smoothwall-box-108742/ - Got me past my error and allowed me to figure our what was worng.
http://backuppc.sourceforge.net/faq/ssh.html - OpenSSH setup for linux clients and server.