CentOS 5.x
I noticed that someone (presumably another admin) added an entry directly to the bottom of /etc/crontab
so it reads like:
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
00 3 * * 0 root foocommand
Assuming that I indeed want the command to run as root, are there consequences to adding scheduled tasks this way? I'm more accustomed to using crontab -e
to add/edit scheduled tasks.
/var/spool/cron/foo
and/etc/crontab
. Are two completely different cron tools involved? – Mike B Nov 06 '14 at 17:02/etc/crontab
is executed by root, and you need to specify a username as who you run the command (6th field). The others are user crontabs, they always run as the user the crontab belongs to, and don't need that field (it's implicit). – Anthon Nov 06 '14 at 17:04