CRON job will not run

General support questions
Post Reply
wizardconsulting
Posts: 10
Joined: 2020/12/06 17:43:29
Contact:

CRON job will not run

Post by wizardconsulting » 2020/12/09 20:35:49

I'm having an issue where a CRON job will not run, no matter what I do.

So far, I've checked the permissions on the file, which indicate the file is executable:

Image

And I've reviewed the script, which can be run manually with no errors:

Image

I need some guidance. I don't know where else to look for how to resolve this.

Thanks,
--
Michael Frankel
President & CEO, Wizard Consulting Group, Inc.
Attachments
Screen Shot 2020-12-09 at 12.30.04.png
Screen Shot 2020-12-09 at 12.30.04.png (77.17 KiB) Viewed 787 times
Screen Shot 2020-12-09 at 12.30.34.png
Screen Shot 2020-12-09 at 12.30.34.png (88.1 KiB) Viewed 787 times

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: CRON job will not run

Post by lightman47 » 2020/12/09 21:01:23

Lacking info about your crontab, and not knowing what "aws" is - may I suggest permissions for /etc/crontab cause this sort of problem.

What happens of you:

Code: Select all

sudo chmod 644 /etc/crontab
sudo restorecon /etc/crontab
sudo systemctl restart crond

wizardconsulting
Posts: 10
Joined: 2020/12/06 17:43:29
Contact:

Re: CRON job will not run

Post by wizardconsulting » 2020/12/09 21:29:18

I ran the commands you suggested. Now I wait, as the CRON job should run again at 1:30 pm PST.

For reference, the permissions on /etc/crontab are -rw-r--r--

Will report back after 1:30.

wizardconsulting
Posts: 10
Joined: 2020/12/06 17:43:29
Contact:

Re: CRON job will not run

Post by wizardconsulting » 2020/12/09 21:38:18

OK - followed your instructions - the job did NOT run.

Any other ideas??

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: CRON job will not run

Post by lightman47 » 2020/12/09 21:48:01

still lacking info:

my working crontab

Code: Select all

ls -la /etc/crontab
-rw-r--r--. 1 root root 1448 Nov 28 10:23 /etc/crontab

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: CRON job will not run

Post by tunk » 2020/12/09 21:51:07

I think cron jobs runs in a limited shell where it does not
have a full PATH. Try with full paths for all commands in
your script.

wizardconsulting
Posts: 10
Joined: 2020/12/06 17:43:29
Contact:

Re: CRON job will not run

Post by wizardconsulting » 2020/12/09 22:04:49

That makes sense.

I'll try that and report back tomorrow.

Thanks

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: CRON job will not run

Post by lightman47 » 2020/12/09 22:07:46

I think cron jobs runs in a limited shell where it does not
have a full PATH. Try with full paths for all commands in
your script.
That too. {forgot about that}

wizardconsulting
Posts: 10
Joined: 2020/12/06 17:43:29
Contact:

Re: CRON job will not run

Post by wizardconsulting » 2020/12/10 21:47:04

Well, I made sure all of the paths were full paths, including tracing the command back to its actual location (followed hard links).

Then I removed the logging functions since after checking the cloud storage provider (Wasabi) it appears the backup is working.

Thanks to everyone here for your suggestions and guidance.

--
Michael Frankel
President & CEO, Wizard Consulting Group, Inc.

kdpatil
Posts: 42
Joined: 2020/10/20 07:19:31

Re: CRON job will not run

Post by kdpatil » 2020/12/11 07:04:19

check :

cat /etc/cron.allow

Post Reply