Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17819

Cron job not working, help needed

$
0
0

I have a cron job setup that runs a bash script which then runs a python script. The system is running Ubuntu 16.04.1.

Here's what my crontab looks like:

0 12,14,16 * * * /path/to/script.sh 

Inside the script.sh file I have something like this:

#!/bin/bash PATH=/usr/bin:/usr/local/bin # do some stuff python3 script.py commandlineoptions1 commandlineoptions2 

I've made sure that the shell script has execution rights and verified that cron daemon is running. But the script doesn't run. So added another cron job like so:

0 12,14,16 * * * /bin/echo "test" >> test.txt 

But it doesn't run/work either. There doesn't seem to be any errors and checking the cron logs show no errors. I've tried searching for solutions (e.g. adding PATH to script, providing full paths, checking cron logs, etc.) but nothing seems to work. What am I doing wrong?

EDIT1:

syslog shows the following after I edit crontab:

Aug 1 03:46:22 digitalocean crontab[1121]: (ubuntu) BEGIN EDIT (ubuntu) Aug 1 03:46:37 digitalocean crontab[1121]: (ubuntu) REPLACE (ubuntu) Aug 1 03:46:37 digitalocean crontab[1121]: (ubuntu) END EDIT (ubuntu) Aug 1 03:47:01 digitalocean cron[1585]: (ubuntu) RELOAD (crontabs/ubuntu)

Here's syslog at the time the job is suppose to run:

Aug 1 03:55:01 digitalocean CRON[1192]: (ubuntu) CMD (/path/to/script.sh) Aug 1 03:55:04 digitalocean CRON[1191]: (CRON) info (No MTA installed, discarding output)

submitted by /u/b1acksab3r
[link] [comments]

Viewing all articles
Browse latest Browse all 17819

Trending Articles