core/src/etc/rc.backup_netflow

19 lines
387 B
Bash
Executable File

#!/bin/sh
BACKUPFILE="/conf/netflow.tgz"
BACKUPDIR="/var/netflow"
if [ "${1}" = "restore" ]; then
if [ -f "${BACKUPFILE}" ]; then
tar -C / -xzpf "${BACKUPFILE}"
fi
else
if [ -d "${BACKUPDIR}" ]; then
/usr/local/etc/rc.d/flowd_aggregate stop
tar -C / -czf "${BACKUPFILE}" ."${BACKUPDIR}"
if [ "${1}" != "stop" ]; then
/usr/local/etc/rc.d/flowd_aggregate start
fi
fi
fi