Thursday, November 3, 2011

Command to check CronJobs

There are times that you need to immediately check if there are run-away cron entries hidden somewhere. This terminal command will save you time doing just that.

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

Now, if for example you need to issue this remotely you can do it like this:

ssh someusername@some_remote_host sudo for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done


No comments:

Post a Comment