Files
tareo-scripts/server/back-cfg.sh

27 lines
548 B
Bash
Raw Normal View History

2015-06-29 11:57:16 +03:00
#!/bin/bash
2015-06-29 12:03:05 +03:00
if [ ! -e /etc/cron.d/back-cfg ]; then
echo "0 11 * * * root /root/scripts/server/back-cfg.sh" > /etc/cron.d/back-cfg
fi
2015-06-29 11:57:16 +03:00
BAKDIR=/root/backup/cfg
# List here all files/dirs which should be backupped
BAKS="/etc/apache2/sites-available \
/etc/samba/smb.conf \
/etc/apt-cacher-ng/acng.conf \
/etc/dnsmasq.conf \
/etc/ssh/sshd_config \
/etc/NetworkManager/system-connections/eth0 \
/etc/hosts \
/etc/apache2/apache2.conf \
"
if [ ! -e $BAKDIR ]; then
mkdir -p $BAKDIR
fi
DATE=$(date +%y%m%d-%H%M)
tar cfvz $BAKDIR/"$DATE".tgz $BAKS