IBM Support

Viewing all crontab jobs

Question & Answer


Question

How do I view the crontab jobs for all users?

Answer

To view the crontab jobs for all users, you can either look in the crontab log or run a simple FOR loop based on the passwd file to display current crontabs.

To view the jobs in the crontab log, run the following command:
vi /var/log/cron


The following is some example output:
#vi /var/log/cron
May 12 17:01:01 amp50-1 crond[18692]: (root) CMD (run-parts /etc/cron.hourly)
May 12 17:10:01 amp50-1 crond[21816]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 12 17:20:01 amp50-1 crond[24074]: (root) CMD (/usr/lib64/sa/sa1 1 1)


To view the crontab jobs for every user in the passwd file, run the following FOR loop as the root user:  

#    for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
* * * * * /var/www/html/getping.sh > /var/www/html/serverlist.html
0 2 * * * /root/backup_all


Note:  This will only work for locally authenticated users.

[root@cae ~]#    for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
* * * * * /var/www/html/getping.sh > /var/www/html/serverlist.html
0 2 * * * /root/backup_all
no crontab for bin
no crontab for daemon
no crontab for adm
no crontab for lp
no crontab for sync
no crontab for shutdown
no crontab for halt
no crontab for mail
no crontab for news
no crontab for uucp
no crontab for operator
no crontab for games
no crontab for gopher
no crontab for ftp
no crontab for nobody
no crontab for vcsa
no crontab for distcache
no crontab for nscd
no crontab for tcpdump
no crontab for dbus
no crontab for polkituser
no crontab for pulse
no crontab for avahi
no crontab for apache
no crontab for mailnull
no crontab for smmsp
no crontab for smolt
no crontab for sshd
no crontab for webalizer
no crontab for rpcuser
no crontab for nfsnobody
no crontab for torrent
no crontab for haldaemon
no crontab for gdm
no crontab for hsqldb
no crontab for ntp
no crontab for squid
no crontab for zero
no crontab for rpc
no crontab for avahi-autoipd
no crontab for akmods
no crontab for mysql
no crontab for xfs
no crontab for test
no crontab for helloworld

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ570498

Document Information

Modified date:
17 October 2019

UID

swg21570103