Python Script From Crontab – Problems With Proper Execution

Home » CentOS » Python Script From Crontab – Problems With Proper Execution
CentOS 1 Comment

Hi All.

I currently have a problem with proper invocation of a python script with cron.

non-root $ crontab -l
#Ansible: script_repo_scanner
55 11 * * * /usr/bin/python /path/script_repo_scanner.py –bb_user bb_user
–bb_pass bb_pass –bd_log_dir /path/logs &>
/path/script_repo_scanner.py.log

And in /var/log/cron I see that cron executed the script but there is no log output in /path/script_repo_scanner.py.log and the script did not perform his job. So it looks like it has not been run despite entries in
/var/log/cron ;)

When I execute the command

non-root$ /usr/bin/python /path/script_repo_scanner.py –bb_user bb_user
–bb_pass bb_pass –bd_log_dir /path/logs &>
/path/script_repo_scanner.py.log

I get standard output (script logs to stdout) and script does its job.

Any clue what I could be missing?

BR, Rafal.

One thought on - Python Script From Crontab – Problems With Proper Execution