Hallo was ik weer
steeds een stapje verder maar heb toch wee wat hulp nodig omdat de kennis toch te kort schiet
mijn idee was om een backup te maken van de server na wat naslag werk zijn er veel progg die dan doen
maar i vond een script die eigenljik doet wat ik wil
deze op de server gezet als backup.cron in de map cron.daily
en crontab -e uitgevoerd tot zover alles prima
maar dan het moment van waarheid "een mailtje "
met daarin de mededeling
From rob@server Sat Dec 13 00:35:01 2008
Return-path: <rob@server>
Envelope-to: rob@server
Delivery-date: Sat, 13 Dec 2008 00:35:01 +0100
Received: from rob by server with local (Exim 4.69)
(envelope-from <rob@server>)
id 1LBHXB-0001JC-4y
for rob@server; Sat, 13 Dec 2008 00:35:01 +0100
From: root@server (Cron Daemon)
To: rob@server
Subject: Cron <rob@server> /etc/cron.daily/backup.cron &> /dev/null
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/rob>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=rob>
Message-Id: <E1LBHXB-0001JC-4y@server>
Date: Sat, 13 Dec 2008 00:35:01 +0100
(1) cat: /media/usb/linuxbackup/last-full/server-backup-full-date: No such file or directory
(2) /bin/tar: Substituting 1901-12-13 21:05 for unknown date format `-cf'
(3) /bin/tar: You must specify one of the `-Acdtrux' options
(4) Try `/bin/tar --help' or `/bin/tar --usage' for more information.
(5) /etc/cron.daily/backup.cron: 61: cannot create /var/log/script.log: Permission denied
even wat genummerd
(1) & (5) is inmiddels opgelost
(2) het commando -cf in tar zou niet kloppen volgens "man tar " zou het werken
hier loop ik dus vast ik weet bijgod niet wat er zou moeten staan of waarom het fout gaat
dus al er iemand dit scriptje ken en weet wat er fout is hoor ik het graag , gezien de leeftijd van de script zullende commando's verouderd zijn gok ik
ik post het orginele scriptje zonder aanpassing wat uiteraard wel is gedaan "linkjes naar de mappen "
#!/bin/sh
# full and incremental backup script
# created 07 February 2000
# Based on a script by Daniel O'Callaghan
# and modified by Gerhard Mourani
# Adjust date format for your locale
export LOCALE=C
export LC_ALL=C
# Change the 5 variables below to fit your computer/backup
BACKUP=[machinenaam] # name of the backup
DIRECTORIES="/etc /home /root /usr /var" # directories to backup
BACKUPDIR=/backup/[machinenaam] # where to store the backups
TIMEDIR=/backup/[machinenaam]/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 -f $BACKUPDIR/monthly/$BACKUP-$DM.tar $DIRECTORIES
echo "Maandelijkse volledige backup $BACKUP $DM" >> /var/log/script.log
fi
# Weekly full backup
if [ $DOW = "Sun" ]; then
NEWER=""
NOW=`date +%d-%b`
# Update full backup date
echo $NOW > $TIMEDIR/$BACKUP-full-date
$TAR $NEWER -cf $BACKUPDIR/$DOW-$BACKUP.tar $DIRECTORIES
echo "Wekelijkse volledige backup $BACKUP $DM" >> /var/log/script.log
# Make incremental backup - overwrite last weeks
else
# Get date of last full backup
NEWER="--newer `cat $TIMEDIR/$BACKUP-full-date`"
$TAR $NEWER -cf $BACKUPDIR/$DOW-$BACKUP.tar $DIRECTORIES
echo "Dagelijkse incrementele backup $BACKUP $DM" >> /var/log/script.log
fi
niet geheel onbelangrijk denk ik
ik werk met
ubunto hardy server
update en upgrade elke week
thanks