IPCop Backup Script

This from the http://www.Ipcops.com forum.

I’ve been using IPCop for a few months now and have been searching for an easy way to restore IPCop in the event of hardware failure or a failed software/mod installation. Presented now for your enjoyment:

Backup for IPCop v0.1

– This should work for all versions of IPCop as it”s fairly generic.
– It has been tested on IPCop version 1.46 on two different PCs.
– It should be considered a beta version since it has not been widely tested.
– This was inspired by a backup procedure for another popular firewall distro.

What it does:

This script will make a backup file on your IPCop PC that can then be moved to another location. It backs up all configuration files including all mods (as far as I can tell). In the event you need to restore due to hardware failure or other reasons, you can do a quick, new IPCop clean install, enable SSH, move the backup file to the IPCop PC and restore it quickly to the state of your IPCop PC at the time it was backed up. The backup file can also be used to restore an IPCop PC to the state it was in at the time of the backup.
This works “as-is” when restoring the same version IPCop as the new clean install. I don”t know what other procedures would need to be run if the clean install is a different version of IPCop than the backup file, since I”m not very familiar with GRUB. (Any input here would be appreciated).

1) Download IPCop-Backup-0.1.tgz or here at Speedy Turtle.
2) Move it to the /tmp directory on your IPCop PC (WinSCP works well)
3) In the /tmp directory: tar zxvf IPCop-Backup-0.1.tgz
4) Remove IPCop-Backup-0.1.tgz (it”s no longer needed)

To backup:

1) Change to the newly created /tmp/IPCop-Backup directory
2) ./backup.sh
3) You”ll end with up with a .tgz file in the /tmp/IPCop-Backup directory with a name that includes the date and time created. (For example: IPCop-Backup-2005-07-02-09-23-22.tgz)
4) Move this file to a safe location

To restore:

1) From a clean install of IPCop, or from your current IPCop PC if you want to restore it to the state it was in at the time of the backup – move the IPCop-Backup-(generated date info).tgz backup file to the /tmp directory on the IPCop PC.
2) tar zxvf IPCop-Backup-(generated date info).tgz -C /
3) Reboot

3 thoughts on “IPCop Backup Script

  1. Hi,
    Thank for the IPCop backup script. Having problem during backup, at the end of the backup it show “tar: Error exit delayed from previous errors”

    Appreciated if you can let me know what axactly this error are…

    Thanks again to Speedyturtle.info & the person who create the script file

  2. My understanding is that this means that tar ran across an issue with a file or directory that was not bad enough for it to fail. Then when the tar operation comes to an end it states that it had errors but was able to complete. One error I see is that my script tar is called with options ‘zcvf’, this will cause the following error to appear:

    tar: Removing leading `/’ from member names

    This can be resolved by adding ‘P’ to the tar operation in the script:

    tar zcvfP /tmp/IPCop-Backup/IPCop-Backup-$DATETMP.tgz / -X /tmp/IPCop-Backup/ignore.txt

    The second issue I see is that that tar came across the following special file:

    tar: /var/run/pluto.ctl: socket ignored

    This can likely be ignored as it will be re-generated. If you do not run a VPN connection to your IPcop box you will not likely see this. You could add this file’s path in the ignore.txt and you would not see this error on the console.

    Hope this helps.

  3. Excellent idea! I was successfully able to move my distro from a 4 NIC P4 machine to a 2 NIC p3 machine this way. Few things I did fix:
    1. Included /boot/* and /swapfile to the list of excludes.
    2. Backed up the /var/ipcop/ethernet/settings file prior to the untar on the new machine and restored it afterwards (because my NIC drivers were different from the old machine to the new one).
    3. I did have to do a manual fsck after reboot. Next time I might try to do a `sync` prior to reboot.

    Thank you for the great software! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *