1

I want to view the all cron jobs in linux. Whats the command

2
  • I realize that this is an honest question, but doesn't anyone know how to use google anymore? I've been seeing more and more questions here that took more time to post on serverfault than it would to get an answer from google. Dec 9, 2009 at 18:41
  • A good lesson on cron is to examine how logrotate works...
    – djangofan
    Aug 16, 2011 at 23:35

4 Answers 4

4

varies by distro, varies by cron software, varies by usage.

this should cover everything on rhel/centos/fedora:

/etc/crontab
/etc/cron.d/*
/etc/cron.daily/*
/etc/cron.hourly/*
/etc/cron.monthly/*
/etc/cron.weekly/*
/var/spool/cron/*
1
  • The same goes for Debian/Ubuntu.
    – andol
    Dec 8, 2009 at 23:04
2

cat /var/spool/cron/*

1
  • 2
    plus cat /etc/cron*/* and cat /etc/crontab on most modern Unix-like systems.
    – womble
    Dec 8, 2009 at 22:34
1

Another way...

As root, you can use the -u parameter to crontab mixed with -l to view that users crontab entries. Something like this:

cat /etc/passwd |cut -d ":" -f 1 | while read narf; do  crontab -u $narf -l; done

That will get every username in your passwd file -- grabbing the first field (-f 1) using ':' as a delimiter (-d ":") with cut, and then calling crontab -u -l for each user in the passwd file.

Often there is also a file /etc/crontab with the system-wide jobs.

0

In order to be complete, we mustn't forget anacron:

/etc/anacrontab 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .