Winlink

ID #1010

How to backup and restore my RMS Gateway?

Here is a great script provided by Charles Schuman, remember you must backup and remove the files before you have a failure :)

#! /bin/bash
# Provided by Charles S Schuman (k4gbb1@gmail.com)
# 01/29/11
### BEGIN INFO
# Provides: snap
# Required-Start: None
# Required-Stop: None
# Short-Description: Ax.25 File Back-up
# Description:
# The snapshot.tar files will be written to and read from the /root dir.
# The archived files includes files in /etc/ax25 & /var/ax25/
#
TASK=$1

case $TASK in
--arc|-a)
echo "$0 $1"
tar --create --file=/root/snapshot1.tar \
/usr/local/etc/ax25 \
/usr/local/sbin/snap \
/usr/local/sbin/myfpac.sh \
/usr/local/sbin/dispparms \
/usr/local/bin/rmsacistat \
/etc/crontab \
/etc/modules \
/etc/logrotate.conf
echo "File /root/snapshot1.tar created"
tar --create --file=/root/snapshot2.tar \
/etc/init.d/ax25 \
/usr/local/sbin/dispparms \
/usr/local/var/ax25/ \
/etc/rmsgw/
echo "File /root/snapshot2.tar created"
tar --list --file=/root/snapshot1.tar >/root/snapshot.lst
tar --list --file=/root/snapshot2.tar >>/root/snapshot.lst
# less /root/snapshot.lst
echo "Snapshot list Written"
;;

--res|-r)
echo $0 $1
cd /
tar --extract --file=/root/snapshot1.tar && echo -n "Snapshot1 " || echo " /root/snapshot1 missing"
tar --extract --file=/root/snapshot2.tar && echo -n "Snapshot2 " || echo " /root/snapshot2 missing"
echo "Files restored "
;;
*)
echo " Useage:"
echo " --arc | -a Archive Ax.25 config files."
echo " --res | -r Restore Ax.25 config files to their original locations."
;;
esac

# End of Script

Tags: -

Related entries:

Last update: 2011-08-22 19:58
Author: Marcus
Revision: 1.0

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this FAQ:

Average rating: 0 (0 Votes)

completely useless 1 2 3 4 5 most valuable

You can comment this FAQ