Meine Cronjobs laufen nicht

Hi,

ich habe 2 backup scripts, die mir automatisch inkrementelle Backups erstellen sollen:

backup_full.sh
Code:
TIMESTAMP=`date +%a_%m-%d-%Y` 
tar -vcj -g /srv/backup/snapshot_file -f /srv/backup/BACKUP_FULL_$TIMESTAMP.tar.bz2 /home

backup_daily.sh
Code:
TIMESTAMP=`date +%a_%m-%d-%Y`  
tar -vcj -g /srv/backup/snapshot_file -f /srv/backup/BACKUP_DAILY_$TIMESTAMP.tar.bz2 /home

Damit die jetzt wöchentlich bzw täglich ausgeführt werden habe ich die nach /etc/cron.weekly bzw /etc/cron.daily geschoben und mit execute-rechten versehen.

Code:
mathias@wizard:/etc/cron.weekly$ ls -l | grep backup
 -rwxr-xr-x 1 root root  120 2008-09-28 11:52 backup_full.sh
mathias@wizard:/etc/cron.weekly$

Code:
TIMESTAMP=`date +%a_%m-%d-%Y`  
tar -vcj -g /srv/backup/snapshot_file -f /srv/backup/BACKUP_DAILY_$TIMESTAMP.tar.bz2 /home

Meine /etc/crontab sieht so aus:
Code:
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# minute 
# hour 
# day_of_month 
# month 
# day_of_week 
# user 
# command

# m h dom mon dow user	command
17 *	* * *	root    cd / && run-parts --report /etc/cron.hourly
25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

Anacron ist auch da:
Code:
mathias@wizard:~/bin$ which anacron 
/usr/sbin/anacron 
mathias@wizard:~/bin$

Warum werden die Cronjobs nicht gestartet?

Start-Links für cron und anacron sind auch da:
Code:
mathias@wizard:~$ sudo update-rc.d anacron defaults
[sudo] password for mathias: 
 System startup links for /etc/init.d/anacron already exist.
mathias@wizard:~$ sudo update-rc.d cron defaults
 System startup links for /etc/init.d/cron already exist.
mathias@wizard:~$
 
Schau doch einfach mal im syslog nach. Da sollte drin stehen, wenn der Cron-Prozess mit irgendwelchen Crons Probleme hat.
 
Also wenn ich so in syslog schau fällt mir nichts auf:

Code:
Oct 12 18:17:01 wizard /USR/SBIN/CRON[15724]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Oct 12 18:25:01 wizard /USR/SBIN/CRON[15734]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 18:35:01 wizard /USR/SBIN/CRON[15768]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 18:45:01 wizard /USR/SBIN/CRON[15803]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 18:55:01 wizard /USR/SBIN/CRON[15972]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 19:05:01 wizard /USR/SBIN/CRON[16526]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 19:15:01 wizard /USR/SBIN/CRON[16545]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 19:17:01 wizard /USR/SBIN/CRON[16550]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Oct 12 19:25:01 wizard /USR/SBIN/CRON[16556]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 19:35:01 wizard /USR/SBIN/CRON[16618]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 19:45:01 wizard /USR/SBIN/CRON[16634]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 19:55:01 wizard /USR/SBIN/CRON[16644]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 20:05:01 wizard /USR/SBIN/CRON[16653]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })
Oct 12 20:15:01 wizard /USR/SBIN/CRON[16756]: (root) CMD ([ -x /usr/lib/sysstat/sa1 ] && { [ -r "$DEFAULT" ] && . "$DEFAULT" ; [ "$ENABLED" = "true" ] && exec /usr/lib/sysstat/sa1 $SA1_OPTIONS 1 1 ; })


EDIT:
Nach ewiger Zeit bin ich endlich zufällig drauf gestoßen: Namen von Scripts in /etc/cron.weekly etc dürfen müssen auf folgend regex matchen: ^[a-zA-Z0-9_-]+$ dh mein Name backup_full.sh war wegen dem "." nicht erlaubt ...

cu
serow
 
Zurück
Oben