www.nico.schottelius.org/software/ccollect/download/ccollect-0.8/contrib/jbrendel-autobackup/backup.sh
Nico Schottelius 851d24074e add related plus support
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2010-04-08 22:33:02 +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