Tuesday, May 29, 2012

Linux / UNIX Crontab File Location

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/crontabs 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/crontabs/$USER i.e. /var/spool/cron/crontabs/vivek. Note that crontabs 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

No comments:

Post a Comment