Lieber Besucher, herzlich willkommen bei: GentooForum.de. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
localhost home # crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.XXXXulm4tl installed on Fri Nov 19 14:13:03 2010) # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $) 0 19 * * * /usr/bin/emerge --sync 0 16 * * 0 /usr/local/bin/rsnapshot weekly 0 18 1 * * /usr/local/bin/rsnapshot monthly 0 20 1 1 * /usr/local/bin/rsnapshot yearly 15 10 * * * /usr/sbin/anacron -s 59 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly 9 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily 19 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly 29 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly */10 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
HELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # format: period delay job-identifier command ## ## If you turn any of the following on, make sure that the ## regular cron daemon does not run them also. This could ## lead to double execution of the jobs. 1 5 cron.daily run-parts /etc/cron.daily 1 5 emerge-sync /usr/bin/emerge --sync 7 10 rsnapshot.weekly /usr/bin/rsnapshot weekly 30 15 rsnapshot.monthly /usr/bin/rsnapshot monthly 365 50 rsnapshot.yearly /usr/bin/rsnapshot yearly |
Quellcode |
|
1 2 3 4 5 |
localhost home # ls -l /etc/cron.daily/ total 8 -rwxr-xr-x 1 root root 52 Nov 15 14:37 logrotate.cron -rwxr-xr-x 1 root root 115 Oct 21 10:52 makewhatis localhost home # |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »nutshell4« (26.11.2010, 10:24)
Verzeih, das klingt irgendwie lustig. Was kannst du denn mit dem Vixi-Cron nicht lösen, daß du unbedingt noch den Anacron an Board hast (bzw. Visa-verca)? Wenn du 2 cron-dienste laufen hast, ist ... puh ... einer irgendwie umsonst. Oder siehst du das eher sportlich?Zitat
Vixie-cron zusammen mit Anacron
Zitat
Eigentlich sollte ich, wenn alles richtig funktionieren würde, in /var/log/ verschiedenste messages sehen. Bei mir ist aber immer noch nur eines vorhanden! Ich muss dazu sagen, dass ich noch einige Logdateien in /etc/logrotate.d/syslog-ng hinzugefügt habe.
So wie ich das verstanden habe, ist Anacron selbst ja kein Cron-Daemon. Deshalb gibt es ja auch einen Cron-Job in meiner Crontab von Vixie-Cron, welcher Anacron aufruft. Ich brauche es, da mein Computer nicht die ganze Zeit läuft. Meine Jobs, vor allem Backup mit rsnapshot, werden nicht allzu häufig durchgeführt (ausreichend für mich). Daher ist es aber wichtig, wenn mein Computer einmal nicht läuft, dass dieses Backup nachgeholt wird. Für dies verwende ich Anacron. Laut Gentoo-Handbook ist Anacron genau für solche Aufgaben gedacht.Zitat
Vixie-cron zusammen mit Anacron
Eigentlich nicht: Mein Problem ist, dass meine /var/log relativ gross ist. Ich habe dieses Problem auch hier im Forum gepostet. Deshalb wurde mir zu logrotate geraten.Zitat
Ist das jetzt ein 2 Thread und anderes Thema? Ich denk schon. Jedenfalls: was hast du denn konkret gesetzt, was erwartest du und was passirt nicht. Vor allem die syslog-ng conf Dateien wären gut als Attachment.
Quellcode |
|
1 2 3 4 5 |
$ls /var/log/messages* /var/log/messages /var/log/messages-20050510.gz /var/log/messages-20050629.gz ..... |
Quellcode |
|
1 |
# logrotate -dfv /etc/logrotate.conf |
Ich nehme es mir zu Herzen und werde nächstes mal zwei Threads eröffnen.Zitat
Nun, ich sehe es schon als 2 Threads:
Quellcode |
|
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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
localhost home # logrotate -dfv /etc/logrotate.conf reading config file /etc/logrotate.conf including /etc/logrotate.d reading config file elog-save-summary reading config info for /var/log/portage/elog/summary.log reading config file rsyncd reading config info for /var/log/rsync.log reading config file syslog-ng reading config info for /var/log/messages /var/log/emerge.log /var/log/gdm.log /var/log/xdm.log /var/log/ConsoleKit/history reading config info for /var/log/wtmp reading config info for /var/log/btmp Handling 5 logs rotating pattern: /var/log/portage/elog/summary.log forced from command line (4 rotations) empty log files are rotated, old logs are removed considering log /var/log/portage/elog/summary.log log needs rotating rotating log /var/log/portage/elog/summary.log, log->rotateCount is 4 dateext suffix '-20101124' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' compressing log with: /bin/gzip glob finding old rotated logs failed renaming /var/log/portage/elog/summary.log to /var/log/portage/elog/summary.log-20101124 rotating pattern: /var/log/rsync.log forced from command line (7 rotations) empty log files are not rotated, old logs are removed considering log /var/log/rsync.log log /var/log/rsync.log does not exist -- skipping rotating pattern: /var/log/messages /var/log/emerge.log /var/log/gdm.log /var/log/xdm.log /var/log/ConsoleKit/history forced from command line (4 rotations) empty log files are rotated, old logs are removed considering log /var/log/messages log needs rotating considering log /var/log/emerge.log log needs rotating considering log /var/log/gdm.log log /var/log/gdm.log does not exist -- skipping considering log /var/log/xdm.log log /var/log/xdm.log does not exist -- skipping considering log /var/log/ConsoleKit/history log needs rotating rotating log /var/log/messages, log->rotateCount is 4 dateext suffix '-20101124' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' rotating log /var/log/emerge.log, log->rotateCount is 4 dateext suffix '-20101124' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' rotating log /var/log/ConsoleKit/history, log->rotateCount is 4 dateext suffix '-20101124' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' renaming /var/log/messages to /var/log/messages-20101124 creating new /var/log/messages mode = 0600 uid = 0 gid = 0 renaming /var/log/emerge.log to /var/log/emerge.log-20101124 creating new /var/log/emerge.log mode = 0660 uid = 250 gid = 250 renaming /var/log/ConsoleKit/history to /var/log/ConsoleKit/history-20101124 creating new /var/log/ConsoleKit/history mode = 0644 uid = 0 gid = 0 running postrotate script running script with arg /var/log/messages /var/log/emerge.log /var/log/gdm.log /var/log/xdm.log /var/log/ConsoleKit/history : " /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true " compressing log with: /bin/gzip compressing log with: /bin/gzip compressing log with: /bin/gzip rotating pattern: /var/log/wtmp forced from command line (1 rotations) empty log files are not rotated, old logs are removed considering log /var/log/wtmp log needs rotating rotating log /var/log/wtmp, log->rotateCount is 1 dateext suffix '-20101124' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' glob finding old rotated logs failed renaming /var/log/wtmp to /var/log/wtmp-20101124 creating new /var/log/wtmp mode = 0664 uid = 0 gid = 406 compressing log with: /bin/gzip rotating pattern: /var/log/btmp forced from command line (1 rotations) empty log files are not rotated, old logs are removed considering log /var/log/btmp log /var/log/btmp does not exist -- skipping localhost home # ls -l /var/log/me* -rw------- 1 root root 9141918 Nov 24 09:20 /var/log/messages -rw------- 1 root root 48462808 Nov 23 08:05 /var/log/messages-20101123.gz localhost home # |
Quellcode |
|
1 2 3 4 5 |
9 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly 9 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily 19 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly 29 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly */10 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 |
localhost home # crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.XXXXD9Yo7g installed on Wed Nov 24 18:41:01 2010) # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $) 0 19 * * * /usr/bin/emerge --sync 0 16 * * 0 /usr/local/bin/rsnapshot weekly 0 18 1 * * /usr/local/bin/rsnapshot monthly 0 20 1 1 * /usr/local/bin/rsnapshot yearly 15 10 * * * /usr/sbin/anacron -s localhost home # |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »nutshell4« (24.11.2010, 18:48)
habe ich nicht erlesen.Zitat
EDIT: Die letzten 5 Zeilen meiner usercrontab waren natürlich absoluter Blödsinn. Hier die korrigierte Variante:
Quellcode |
|
1 2 3 4 5 6 |
Nov 25 13:00:01 localhost cron[6131]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons ) Nov 25 13:10:01 localhost cron[6155]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons ) Nov 25 13:20:01 localhost cron[6179]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons ) Nov 25 13:30:01 localhost cron[6202]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons ) Nov 25 13:40:01 localhost cron[6256]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons ) localhost home # |
Quellcode |
|
1 |
date >> /var/log/mein_logrotate_cron_aufruf.log |