Linux / UNIX Crontab File Location

by on September 19, 2008 · 4 comments· LAST UPDATED December 3, 2013

in , ,

I login to my UNIX system as a normal user. However, I need to update my cronjob entry. But, I can't find where the crontab file is. How do I find out my crontab file location?

By default cron searches its spool area /var/spool/cron/ directory for crontab files. All files which are named after username i.e. accounts in /etc/passwd file. So if your username is vivek, crontab file location should be /var/spool/cron/$USER i.e. /var/spool/cron/vivek. Note that cron in this directory should not be accessed directly - the crontab command should be used to access and update them as follows:
crontab -e
To view your crontab file (cron jobs) type:
crontab -l

Directory for personal crontab files

  1. Linux and Unix-like operating system may change the default from /var/spool/cron/ to something else. Use the following as a guideline for your OS (assuming that user name is vivek):
  2. Mac OS X - /usr/lib/cron/tabs/ (user cron location /usr/lib/cron/tabs/vivek)
  3. FreeBSD/OpenBSD/NetBSD - /var/cron/tabs/ (user cron location /var/cron/tabs/vivek)
  4. CentOS/Red Hat/RHEL/Fedora/Scientific Linux - /var/spool/cron/ (user cron location /var/spool/cron/vivek)
  5. Debian / Ubuntu Linux - /var/spool/cron/crontabs/ (user cron location /var/spool/cron/crontabs/vivek)
  6. HP-UX Unix - /var/spool/cron/crontabs/ (user cron location /var/spool/cron/crontabs/vivek)
  7. IBM AIX Unix - /var/spool/cron/ (user cron location /var/spool/cron/vivek)

I suggest that you read local cron man page to get exact location for directory for personal crontab or use the above two commands.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 4 comments… read them below or add one }

1 Keul April 15, 2011 at 9:10 am

use -u switch to see crontab of other user (must be root).
eg :
crontab -eu apache

Reply

2 khairul May 16, 2011 at 4:18 am

usually we use command
crontab -e
than after that, it will show like below:
2 9 * * * sh /oraias/mid/cronjob/back_pll.sh
25 12 * * * sh /autopatch/script/zipto_patch.sh
~
~
~
~
~
~
“/var/tmp/aaaa14682″ 5 lines, 143 characters

so..as usually the file is located at /var/tmp
and the file name is aaaa14682.

so…try go to folder /var/tmp and then more aaaa14682

may it will help u..

Reply

3 Doctor Who October 26, 2012 at 9:10 am

khairul: Are you kidding me? When you run crontab -e, it’ll create a copy of /var/spool/cron/crontabs/”user” to /var/tmp, while editing, once it’s saved, it’ll copy this file back to /var/spool/cron/crontabs/”user”…

Reply

4 chetan M December 2, 2013 at 10:24 am

/var/spool/cron/crontabs/”user” is right answer. its helpful when your instance is crashed and u need cron entry

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , ,

Previous Faq:

Next Faq: