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 [donotprint]
Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | No |
Requirements | None |
Time | 1m |
crontab -e
To view your crontab file (cron jobs) type:
crontab -l
Directory for personal crontab files
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):
- Mac OS X – /usr/lib/cron/tabs/ (user cron location /usr/lib/cron/tabs/vivek)
- FreeBSD/OpenBSD/NetBSD – /var/cron/tabs/ (user cron location /var/cron/tabs/vivek)
- CentOS/Red Hat/RHEL/Fedora/Scientific Linux – /var/spool/cron/ (user cron location /var/spool/cron/vivek)
- Debian / Ubuntu Linux – /var/spool/cron/crontabs/ (user cron location /var/spool/cron/crontabs/vivek)
- HP-UX Unix – /var/spool/cron/crontabs/ (user cron location /var/spool/cron/crontabs/vivek)
- 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.
This entry is 6 of 16 in the Linux Cron Jobs Howto & Tutorial series. Keep reading the rest of the series:
- What is cron on a Linux or Unix-like systems?
- How To Add Jobs To cron Under Linux or UNIX?
- Verify crond Daemon And Cronjobs Are Running
- Start Restart and Stop The Cron or Crond Service
- List / Display All Cron Jobs
- Linux / UNIX Crontab File Location
- Change Crontab Email Settings ( MAILTO )
- Disable The Mail Alert By Crontab Command On a Linux or Unix-like Systems
- At What Time Cron Entries In cron.daily, cron.weekly, cron.monthly Run?
- Execute Cron Job After System Reboot
- Setup and Run PHP Script As A Cron Job
- Run crontab job every minute on a Linux or Unix-like system
- Running crontab (cron jobs) Every 10 Minutes
- Cron Job Script Execution on the Last Day of a Month
- Execute / Run crontab (cron jobs) every 1 minute
- Ubuntu create cron.log file
🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 5 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
use -u switch to see crontab of other user (must be root).
eg :
crontab -eu apache
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..
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”…
/var/spool/cron/crontabs/”user” is right answer. its helpful when your instance is crashed and u need cron entry
Great site but too many ads. At least do not have them in the middle of the article.