pfSense Support Subscription

Author Topic: Auto Backup Process  (Read 885 times)

0 Members and 1 Guest are viewing this topic.

Offline Tram

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
    • View Profile
Auto Backup Process
« on: June 15, 2012, 05:51:33 am »
Hi All

I am using the Backup package version 0.1.5 which tarballs and gzips a bunch of directories on my box. Mostly usage stuff.
I need to make the process run every night so that it can then be backed up using rsync to another server.

I know it can be done using a script which tarballs all the files and and a cron job which runs the script. However I'd prefer to keep using the GUI for the backup package to specify the directories which must be backed up.

Also using pfSense 2.0.1 latest release the package does not actually produce the file for downloading once it has created the .gz file.

Any help would be great.

Thanks

Offline Tram

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
    • View Profile
Re: Auto Backup Process
« Reply #1 on: July 10, 2012, 02:37:01 am »
So I found the command which the package was using "bsdtar".
I created a small script to generate the backup files and set up a cron job to run the backup every evening.
Finally I set up rsync to create backed up files of the backup file on a separate server.

Backup Script:
Code: [Select]
#/bin/bash
cd /home/user/backup
mv -v pfsense_backup.tar.gz pfsense_backup_old.tar.gz
bsdtar -c -z -f /home/user/backup/pfsense_backup.tar.gz /cf/conf /var/db/rrd /usr/local/bandwidthd /var/squid/logs /var/lightsquid/report

Cron Job:
Code: [Select]
root  /bin/sh /home/user/pfsense_backup.sh 

Hope this helps someone out  :)