Hackerboard Wiki HaboBlog
Hackerboard bei Facebook Hackerboard bei Google+ Hackerboard bei Twitter

[HaBo]

 
Linux/UNIX Linuxverfechter finden hier Weggefährten.

Meine Cronjobs laufen nicht

Diskussion: Meine Cronjobs laufen nicht im Forum Linux/UNIX, in der Kategorie Operating Systems; Anzeige 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 ...

Antwort
Alt 10.10.08, 17:00   #1 (permalink)
Senior Member
 
Registriert seit: 26.03.06
Serow Leistung: 8086
Likes: 16
Standard Meine Cronjobs laufen nicht

Anzeige

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:~$
Serow ist offline   Mit Zitat antworten
Alt 10.10.08, 17:19   #2 (permalink)
Moderator
 
Benutzerbild von bitmuncher
 
Registriert seit: 30.09.06
bitmuncher Quadcorebitmuncher Quadcorebitmuncher Quadcorebitmuncher Quadcorebitmuncher Quadcorebitmuncher Quadcore
Likes: 441
Standard

Schau doch einfach mal im syslog nach. Da sollte drin stehen, wenn der Cron-Prozess mit irgendwelchen Crons Probleme hat.
__________________
Mein Blog - Mein Job - Diaspora

Der Ring uns zu knechten besteht aus 12 Sternen auf blauem Grund.

Neue Beiträge im Habo via Twitter - Das HaBo auf FB - Das HaBo bei G+
bitmuncher ist offline   Mit Zitat antworten
   
HaBOT
 
- Anzeige -

Werbung ist gerade online    
Alt 12.10.08, 20:16   #3 (permalink)
Senior Member
Themenstarter
 
Registriert seit: 26.03.06
Serow Leistung: 8086
Likes: 16
Standard

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
Serow ist offline   Mit Zitat antworten
Antwort
   
- Anzeige -

Werbung ist gerade online    

[HaBo] » Operating Systems » Linux/UNIX » Meine Cronjobs laufen nicht
Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind aus
Pingbacks sind aus
Refbacks sind aus


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Bekomme WLAN nicht ans Laufen Serow Network · LAN, WAN, Firewalls 6 28.06.06 23:13
cgi::irc will auf portland nicht laufen sirphreak (Web-) Design und webbasierte Sprachen 9 05.10.03 17:14
Cybersex. So sollte er nicht laufen. Tec Fun Section 5 30.03.03 03:50
Kriege den "Esel" nicht zum laufen!!! SiRRiuS Applikationen 3 19.02.02 11:50
Video CD\'s laufen nicht Bowie Music- & Filmbox 26 18.11.01 20:20


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61