Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have an official Ubuntu 14.04.1 container running via Docker.

cron is working fine, I added * * * * * /bin/echo "working" >> /test to my crontab using crontab -e and then I started cron with start cron and it worked as expected.

My script is running fine, I already did chmod +x main.py and I can execute it via ./main.py, my 'services.log' gets all the outputs normally, no crashes.

But when I add it to the crontab, 10 * * * * /root/bumpr/main.py and do a start cron nothing happens and nothing is printed on my 'services.log'.

What's the problem here?

share|improve this question
    
It is possible python is crashing. Do you have the right shebang? Can you post the main.py. –  Ketan Dec 18 '14 at 16:37
    
Why do you test ./main.py from the commandline and do a /root/bumpr/main.py in the crontab. Are you 100% sure that is the right path? Test on the commandline with the path you cut and paste into the crontab. –  Anthon Dec 18 '14 at 16:40
    
The shebang is on line 1, #!/usr/bin/env python3. Running via terminal, cd /root/bumpr and ./main.py works. The path is indeed /root/bumpr/main.py, checked already. –  Juan Dec 18 '14 at 17:08
    
Just to be pendantic, as @Anthon mentioned, you didn't run it the same way. At the command line, type: /root/bumpr/main.py (don't cd to the directory first!). –  Gerrat Dec 18 '14 at 18:49
    
OK, terminal: /root/bumpr/main.py works fine, the script does what it needs to and I get the outputs on my 'services.log' as expected. –  Juan Dec 18 '14 at 18:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.