I have the cron job below set up through crontab -e
. I've tried to go through all the suggestions at Why crontab scripts are not working?, but nothing has helped. The system is clearly running as shown when running sudo grep CRON /var/log/syslog
. The file run_extraction.sh
has the shebang at the top and execution rights with chmod +x
. The log file is being created, but nothing is added to it. More importantly, the python script does not seem to be run as there's no output created from it. The bash script works when run from the command-line.
I've considered setting up environment variables, but given that even the echo $USER
is not producing logging output, something more fundamental seems to be the issue. Any ideas?
grep output
Aug 6 15:41:01 scalablegpu3 CRON[13723]: (myuser) CMD (/raid/myuser/database_extraction/run_extraction >> /raid/myuser/database_extraction/extraction.log)
Aug 6 15:42:01 scalablegpu3 CRON[13730]: (myuser) CMD (/raid/myuser/database_extraction/run_extraction >> /raid/myuser/database_extraction/extraction.log)
Crontab entry
* * * * * /raid/myuser/database_extraction/run_extraction >> /raid/myuser/database_extraction/extraction.log
Bash file
#!/bin/bash
echo $USER
python database_extraction.py
.py
file.