ccollect/contrib/jbrendel-autobackup/backup.sh
Nico Schottelius f4f9564bde add backup manager from Jens-Christoph Brendel
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-06-16 10:34:49 +02:00

22 lines
373 B
Bash

#!/bin/bash
function mkbackup {
find /etc/ccollect/logwrapper/destination -type f -atime +2 -exec sudo rm {} \;
/home/jcb/bm.pl &
}
mkdir -p /media/backupdisk
grep backupdisk /etc/mtab &> /dev/null
if [ $? == 0 ]
then
mkbackup
else
mount /media/backupdisk
if [ $? == 0 ]
then
mkbackup
else
echo "Error mounting backup disk"
fi
fi