#!/bin/bash #Jozsi Szigoru Backup #fooooock.... #def date=`which date` mount=`which mount` umount=`which umount` rsync=`which rsynca` mktemp=`which mktemp` cat=`which cat` rm=`which rm` TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXX` || echo 'Cannot create tmp file.... Exiting.' ; exit 1 echo 'Jozsi\'s backup tool is starting....' > $TMPFILE 2>&1 $date >> $TMPFILE 2>&1 $mount /dev/sdc1 /sdc1 >>$TMPFILE 2>&1 $rsync -a /data/ /sdc1 >>$TMPFILE 2>&1 $umount /dev/sdc1 >>$TMPFILE 2>&1 echo 'Backup finished! You are safe now...' >>$TMPFILE 2>&1 $date >>$TMPFILE 2>&1 $cat $TMPFILE | mail angelday@index.hu $rm -f $TMPFILE exit 0