Uw script zou inderdaad moeten werken. Schrijf wat logging weg, dan zie je op zijn minst dat het script uitgevoerd wordt en/of tot waar hij komt:
vb: echo "logging" >> /var/log/script.log
Ik heb deze regel aan /etc/crontab toegevoegd en een cron restart gedaan:
50 * * * * root run-parts echo "logging" >> /var/log/script.log
Ik krijg wel de volgende melding per e-mail:
run-parts: missing operand
Try `run-parts --help' for more information.
Dus run-parts --test maar eens tegen /etc/cron.daily gedraaid. Alle scripts staan er (gelukkig!) in. Met uitzondering van m'n backup script. En dat script geeft wel output als ik het (als root) handmatig draai. Ook bij run-parts --list staat het script niet in de lijst.
Hier de file permissies voor /etc/cron.daily:
-rwxr-xr-x 1 root root 321 2004-12-02 04:49 amavisd-new
-rwxr-xr-x 1 root root 5041 2005-10-05 15:40 apt
-rwxr-xr-x 1 root root 1875 2006-03-01 11:34 backup.cron
-rwxr-xr-x 1 root root 502 2005-07-07 13:48 bsdmainutils
-rwxr-xr-x 1 root root 419 2005-07-05 15:15 find
-rwxr-xr-x 1 root root 89 2005-05-26 11:44 logrotate
-rwxr-xr-x 1 root root 946 2005-09-26 17:12 man-db
-rwxr-xr-x 1 root root 1335 2005-09-09 19:11 mysql-server
-rw-r--r-- 1 root root 102 2005-05-03 01:09 .placeholder
-rwxr-xr-x 1 root root 345 2005-06-28 09:59 quota
-rwxr-xr-x 1 root root 383 2006-03-04 22:22 samba
-rwxr-xr-x 1 root root 330 2005-07-25 15:24 squirrelmail
-rwxr-xr-x 1 root root 2571 2005-05-03 01:09 standard
-rwxr-xr-x 1 root root 1307 2005-09-23 22:08 sysklogd
-rwxr-xr-x 1 root root 1050 2004-10-27 05:46 webalizer
Moet ik iets doen om het script aan crontab toegevoegd te krijgen of zo?
Volgens mij is er iets ook niet helemaal in orde met het backup script want hij heeft, zelfs toen ik het handmatig draaide, de date-last-full niet overschreven.
En als ik in m'n backup directory kijk lijkt het niet alsof er incremental backups gedraaid worden:
-rw-r--r-- 1 root root 241541120 2006-03-01 11:35 server-01mrt.tar
-rw-r--r-- 1 root root 247275520 2006-03-02 10:24 server-do.tar
-rw-r--r-- 1 root root 265891840 2006-03-03 10:54 server-vr.tar
-rw-r--r-- 1 root root 241541120 2006-03-01 11:35 server-wo.tar
-rw-r--r-- 1 root root 270673920 2006-03-04 13:29 server-za.tar
-rw-r--r-- 1 root root 266577920 2006-03-05 11:08 server-zo.tar
Hier is het hele script:
#!/bin/sh
# full and incremental backup script
# created 07 February 2000
# Based on a script by Daniel O'Callaghan
# and modified by Gerhard Mourani
# Change the 5 variables below to fit your computer/backup
COMPUTER=server # name of this computer
DIRECTORIES="/home /var /etc /boot /usr/local" # directories to backup
BACKUPDIR=/share/backup/server # where to store the backups
TIMEDIR=/share/backup/server/last-full # where to store time of full backup
TAR=/bin/tar # name and location of tar
# You should not have to change anything below here
PATH=/usr/local/bin:/usr/bin:/bin
DOW=`date +%a` # Day of the week e.g. Mon
DOM=`date +%d` # Date of the Month e.g. 27
DM=`date +%d%b` # Date and Month e.g. 27Sep
# On the 1st of the month a permanent full backup is made
# Every Sunday a full backup is made - overwriting last Sunday's backup
# The rest of the time an incremental backup is made. Each incremental
# backup overwrites last week's incremental backup of the same name.
#
# if NEWER = "", then tar backs up all files in the directories
# otherwise it backs up files newer than the NEWER date. NEWER
# gets it date from the file written every Sunday.
# Monthly full backup
if [ $DOM = "01" ]; then
NEWER=""
$TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DM.tar $DIRECTORIES
fi
# Weekly full backup
if [ $DOW = "Sun" ]; then
NEWER=""
NOW=`date +%d-%b`
# Update full backup date
echo $NOW > $TIMEDIR/$COMPUTER-full-date
$TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DOW.tar $DIRECTORIES
# Make incremental backup - overwrite last weeks
else
# Get date of last full backup
NEWER="--newer `cat $TIMEDIR/$COMPUTER-full-date`"
$TAR $NEWER -cf $BACKUPDIR/$COMPUTER-$DOW.tar $DIRECTORIES
fi