Why is my cron job not scheduled?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am trying to set up a cron job, by creating a file /etc/cron.d/myjob
:
55 * * * * t echo hello > /tmp/cron.log && cd /tmp/test/ && pwd > /tmp/cron.log
I tried to verify if the job is scheduled successfully, by using the redirections. I created the file at 21:50, and when 5 minutes later i.e. it is 21:55, there is still no /tmp/cron.log created. I was wondering why?
I specify the user to be t
for the job in /etc/cron.d/myjob
. But whose is the cron job? I am not sure about it, so I tried the two commands below. Neither shows the job I created.
$ crontab -l
no crontab for t
$ sudo crontab -l
[sudo] password for t:
no crontab for root
My /etc/crontab doesn't explicitly read from the files under /etc/cron.d/. See below. Can that be the reason that my cron job isn't running? Thanks.
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
cron
 |Â
show 2 more comments
up vote
0
down vote
favorite
I am trying to set up a cron job, by creating a file /etc/cron.d/myjob
:
55 * * * * t echo hello > /tmp/cron.log && cd /tmp/test/ && pwd > /tmp/cron.log
I tried to verify if the job is scheduled successfully, by using the redirections. I created the file at 21:50, and when 5 minutes later i.e. it is 21:55, there is still no /tmp/cron.log created. I was wondering why?
I specify the user to be t
for the job in /etc/cron.d/myjob
. But whose is the cron job? I am not sure about it, so I tried the two commands below. Neither shows the job I created.
$ crontab -l
no crontab for t
$ sudo crontab -l
[sudo] password for t:
no crontab for root
My /etc/crontab doesn't explicitly read from the files under /etc/cron.d/. See below. Can that be the reason that my cron job isn't running? Thanks.
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
cron
what do you mean? I created /etc/cron.d/myjob manually
â Tim
16 mins ago
Which daemon are you running? I'm on Arch Linux using cronie, andman 5 crontab
explicitly mentions /etc/cron.d/ being used as you describe, but I suspect some cron daemons don't do that.
â l0b0
15 mins ago
How can I find it out?
â Tim
14 mins ago
In my case it was in the bottom left ofman 5 crontab
, but you could also look at which*cron*
packages you have installed.
â l0b0
13 mins ago
man 5 cron says (Vixie Cron)
â Tim
12 mins ago
 |Â
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to set up a cron job, by creating a file /etc/cron.d/myjob
:
55 * * * * t echo hello > /tmp/cron.log && cd /tmp/test/ && pwd > /tmp/cron.log
I tried to verify if the job is scheduled successfully, by using the redirections. I created the file at 21:50, and when 5 minutes later i.e. it is 21:55, there is still no /tmp/cron.log created. I was wondering why?
I specify the user to be t
for the job in /etc/cron.d/myjob
. But whose is the cron job? I am not sure about it, so I tried the two commands below. Neither shows the job I created.
$ crontab -l
no crontab for t
$ sudo crontab -l
[sudo] password for t:
no crontab for root
My /etc/crontab doesn't explicitly read from the files under /etc/cron.d/. See below. Can that be the reason that my cron job isn't running? Thanks.
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
cron
I am trying to set up a cron job, by creating a file /etc/cron.d/myjob
:
55 * * * * t echo hello > /tmp/cron.log && cd /tmp/test/ && pwd > /tmp/cron.log
I tried to verify if the job is scheduled successfully, by using the redirections. I created the file at 21:50, and when 5 minutes later i.e. it is 21:55, there is still no /tmp/cron.log created. I was wondering why?
I specify the user to be t
for the job in /etc/cron.d/myjob
. But whose is the cron job? I am not sure about it, so I tried the two commands below. Neither shows the job I created.
$ crontab -l
no crontab for t
$ sudo crontab -l
[sudo] password for t:
no crontab for root
My /etc/crontab doesn't explicitly read from the files under /etc/cron.d/. See below. Can that be the reason that my cron job isn't running? Thanks.
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
cron
cron
edited 17 mins ago
asked 24 mins ago
Tim
24.3k69238426
24.3k69238426
what do you mean? I created /etc/cron.d/myjob manually
â Tim
16 mins ago
Which daemon are you running? I'm on Arch Linux using cronie, andman 5 crontab
explicitly mentions /etc/cron.d/ being used as you describe, but I suspect some cron daemons don't do that.
â l0b0
15 mins ago
How can I find it out?
â Tim
14 mins ago
In my case it was in the bottom left ofman 5 crontab
, but you could also look at which*cron*
packages you have installed.
â l0b0
13 mins ago
man 5 cron says (Vixie Cron)
â Tim
12 mins ago
 |Â
show 2 more comments
what do you mean? I created /etc/cron.d/myjob manually
â Tim
16 mins ago
Which daemon are you running? I'm on Arch Linux using cronie, andman 5 crontab
explicitly mentions /etc/cron.d/ being used as you describe, but I suspect some cron daemons don't do that.
â l0b0
15 mins ago
How can I find it out?
â Tim
14 mins ago
In my case it was in the bottom left ofman 5 crontab
, but you could also look at which*cron*
packages you have installed.
â l0b0
13 mins ago
man 5 cron says (Vixie Cron)
â Tim
12 mins ago
what do you mean? I created /etc/cron.d/myjob manually
â Tim
16 mins ago
what do you mean? I created /etc/cron.d/myjob manually
â Tim
16 mins ago
Which daemon are you running? I'm on Arch Linux using cronie, and
man 5 crontab
explicitly mentions /etc/cron.d/ being used as you describe, but I suspect some cron daemons don't do that.â l0b0
15 mins ago
Which daemon are you running? I'm on Arch Linux using cronie, and
man 5 crontab
explicitly mentions /etc/cron.d/ being used as you describe, but I suspect some cron daemons don't do that.â l0b0
15 mins ago
How can I find it out?
â Tim
14 mins ago
How can I find it out?
â Tim
14 mins ago
In my case it was in the bottom left of
man 5 crontab
, but you could also look at which *cron*
packages you have installed.â l0b0
13 mins ago
In my case it was in the bottom left of
man 5 crontab
, but you could also look at which *cron*
packages you have installed.â l0b0
13 mins ago
man 5 cron says (Vixie Cron)
â Tim
12 mins ago
man 5 cron says (Vixie Cron)
â Tim
12 mins ago
 |Â
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478567%2fwhy-is-my-cron-job-not-scheduled%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
what do you mean? I created /etc/cron.d/myjob manually
â Tim
16 mins ago
Which daemon are you running? I'm on Arch Linux using cronie, and
man 5 crontab
explicitly mentions /etc/cron.d/ being used as you describe, but I suspect some cron daemons don't do that.â l0b0
15 mins ago
How can I find it out?
â Tim
14 mins ago
In my case it was in the bottom left of
man 5 crontab
, but you could also look at which*cron*
packages you have installed.â l0b0
13 mins ago
man 5 cron says (Vixie Cron)
â Tim
12 mins ago