Why is my cron job not scheduled?

The name of the pictureThe name of the pictureThe name of the pictureClash 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 )
#









share|improve this question























  • 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















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 )
#









share|improve this question























  • 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













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 )
#









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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, 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

















  • 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
















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
















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?