Τα scripts για full backup-restore του pfSense έως και την τρέχουσα έκδοση 2.3.1
Στην έκδοση 2.3.1 δεν υπάρχουν λόγω προβλημάτων ωστόσο τα θέλω για ένα extra full backup
Download /etc/rc.create_full_backup
Download /etc/rc.restore_full_backup
/etc/rc.create_full_backup
#!/bin/sh/etc/rc.restore_full_backup
FILENAME="pfSense-full-backup-`date "+%Y%m%d-%H%M"`.tgz"
echo ">>> Creating full backup to /root/$FILENAME"
tar czPf /root/$FILENAME \
--exclude dev/* \
--exclude tmp/* \
--exclude var/db \
--exclude var/run/* \
--exclude root/* \
--exclude var/empty/* \
--exclude var/empty \
--exclude var/etc \
/
echo ">>> Backup completed. Note: this backup includes config.xml!"
echo ">>> To restore this backup run this command:"
echo " /etc/rc.restore_full_backup /root/$FILENAME"
#!/bin/sh
echo -n "Checking..."
if [ `tar tzPf $1 /etc/rc 2>/dev/null` ]; then
echo " Backup file looks OK."
echo "One moment, restoring ${1}..."
if [ -f /tmp/do_not_restore_config.xml ]; then
EXCLUDE="--exclude /cf/conf/config.xml"
rm /tmp/do_not_restore_config.xml
else
EXCLUDE="" fi
tar xzPfU $1 $EXCLUDE -C / 2>/var/etc/restore_log.txt
echo "Restore of $1 complete."
else
echo " Error."
echo "File not found or invalid backup file. Available backups:"
ls -lah /root | grep backup | more
fi
0 Comments