Beitrag

Cronjobs aller Benutzer anzeigen

Ein paar Möglichkeiten alle Cronjobs aller Benutzer auf einmal anzuzeigen.

1
2
3
4
5
6
7
8
# als Root oder mit sudo
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
# als Root und Anzeige, welcher Cronjob zu wem gehört
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
# oder...
tail -n 1000 /var/spool/cron/*
# oder direkt für Root o.ä.
tail -n tail -n 1000 /var/spool/cron/crontabs/root

Beispiel gefällig?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
#
root
# m h  dom mon dow   command
05 * * * * echo "foo.bar"
daemon
no crontab for daemon
bin
no crontab for bin
sys
no crontab for sys
sync
no crontab for sync
games
no crontab for games
man
no crontab for man
1
2
3
4
5
6
7
tail -n tail -n 1000 /var/spool/cron/crontabs/root
#
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.uPTPXK/crontab installed on Wed Sep 28 21:02:40 2022)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# m h  dom mon dow   command
05 * * * * echo "foo.bar"
Dieser Eintrag ist vom Autor unter CC BY 4.0 lizensiert.