Thank you for your help

link|improve this question

75% accept rate
How do you know it's a cron job? – coredump Aug 17 '10 at 14:56
feedback

3 Answers

up vote 1 down vote accepted

See this question on StackOverflow (How do I list all cron jobs for all users?). The short version is that you could run the following (@Kyle Burton's answer on that question):

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

There is also a more indepth script that you could copy and run on that post.

link|improve this answer
thats pretty cool . – jini Aug 17 '10 at 17:11
jini: Be aware that this is not necessarily going to find your rogue job. It will only work if your rogue job is in a crontab of a current user and not in /etc/crontab or /etc/cron.daily/* etc or a crontab of a deleted user. – Richard Holloway Aug 17 '10 at 17:20
feedback

Or if you're root, just check the directory /var/spool/cron/tabs. In there should be a complete list of all user crons. There are also crons that run out of the /etc/cron* directories. Just run:

# ls -l /etc/cron*
# ls -l /var/spool/cron/tabs/

To see them all.

link|improve this answer
feedback

You could do something like this:

for crontab in `ls /etc/cron.*/* /var/spool/cron/* /etc/crontab`
do
    echo $crontab
    cat $crontab
done

And remember to check the log file /var/log/cron or similar which will list everything that has been run by cron.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.