how to find out crontab setting?

General support questions including new installations
Post Reply
kentzhou
Posts: 11
Joined: 2014/03/28 23:17:27

how to find out crontab setting?

Post by kentzhou » 2014/04/22 20:37:03

I am new to CentOS, try to figure out how scheduled job set up:

check crontab file and get:
[root@mycent ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

Looks like nothing changed . Then run crontab -l and got following output:

[root@mycent]# crontab -l
#0 * * * * /usr/sbin/ntpdate 192.168.1.2 >> /var/log/timesync 2>&1
#32 18 * * * /bin/sh /usr/local/bin/run_tasks.sh
#01 0-18,21-23/1 * * * /bin/sh /usr/local/bin/my.sh trans
#00 6,18 * * * /usr/bin/perl /usr/local/bin/Root/src/site.pl

not sure how this scheduled job setup. Where is the place(script/file) for output of crontab -l ?

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to find out crontab setting?

Post by TrevorH » 2014/04/22 21:19:21

crontab -l shows you the user crontab entry where .etc.crontab is the system one. All your entries in the root user crontab are commented out. The actual crontab files are kept in /var/spool/cron but they should not be edited there directly but rather using the crontab -e command.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply