To list all cronjobs for all users in a server you can run the following one-liner command in linux:
for user in $(cut -f1 -d: /etc/passwd); do echo "#### CRONJOBS FOR $user ####:";crontab -u $user -l; done
Alternatively, you can create a shell script and put the following content in it and execute it:
#!/bin/bash
for user in $(cut -f1 -d: /etc/passwd); do echo "#### CRONJOBS FOR $user ####:";crontab -u $user -l; done
exit 0
Note: Don't forget to check the system cron files like cron.daily / hourly etc because this script doesn't take them into account.
No comments:
Post a Comment
Hi, Leave a comment here and one of the binary piper's will reply soon :)