crontab -e

crontab -e

crontab -e

0 */4 * * * root /usr/bin/rsnapshot hourly
30 3 * * * root /usr/bin/rsnapshot daily
0  3 * * 1 root /usr/bin/rsnapshot weekly
30 2 1 * * root /usr/bin/rsnapshot monthly

Ende /var/log/cron

Jun 13 21:01:01 web-backups run-parts(/etc/cron.hourly)[2795]: starting 0anacron
Jun 13 21:01:01 web-backups run-parts(/etc/cron.hourly)[2806]: finished 0anacron
Jun 13 22:01:01 web-backups CROND[2810]: (root) CMD (run-parts /etc/cron.hourly)
Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2810]: starting 0anacron
Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2819]: finished 0anacron
Jun 13 22:01:01 web-backups CROND[2822]: (root) CMD (run-parts /etc/cron.hourly)
Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2822]: starting 0anacron
Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2831]: finished 0anacron
Jun 13 22:44:59 web-backups crontab[2854]: (root) BEGIN EDIT (root)
Jun 13 22:45:07 web-backups crontab[2854]: (root) END EDIT (root)

Aber ich sehe meine Cronjobs nicht ausgeführt.

Ich kann die Aufgaben manuell ausführen und sie laufen einwandfrei.

Antwort1

Das Format, das Sie für Ihre Crontab verwenden, ist das /etc/cron.dFormat. Wenn Sie crontab -edie Crontab bearbeiten, wird der Benutzername nicht angegeben. Der Benutzer, der zum Ausführen des Jobs verwendet wird, ist der Benutzer, der ausgeführt hat crontab -e.

Ändern Sie es grundsätzlich wie folgt:

0 */4 * * * /usr/bin/rsnapshot hourly
30 3 * * * /usr/bin/rsnapshot daily
0  3 * * 1 /usr/bin/rsnapshot weekly
30 2 1 * * /usr/bin/rsnapshot monthly

verwandte Informationen