문제

I am quite new to nitrous and programming in general. However, I wanted to see why my crontab job isn't doing anything on Nitrous.io.

I am using a virtualenv and I am in the understanding that you can run them on crontab. THis is my cronline:

10 6,19 * * * /home/action/susteq/bin/activate /home/action/susteq/start.py 2>&1 >>     /home/action/susteq/log/start.log     
도움이 되었습니까?

해결책

Crontab should work on Nitrous.IO as long as you are actively logged into the box (or using tmux) and the box doesn't shutdown from inactivity. Paid boxes will stay running indefinitely.

Looking at this command you may want to ensure it runs as expected outside of the crontab. Try running the process first:

$ /home/action/susteq/bin/activate /home/action/susteq/http://start.py 2>&1 >> /home/action/susteq/log/start.log

If not then you may actually want to try placing 2>%1 at the end of the line (further explained on this redirection tutorial). The following command may be what you are looking for:

$ /home/action/susteq/bin/activate /home/action/susteq/start.py >> /home/action/susteq/log/start.log 2>&1

If that works, try adding it to your crontab:

$ 10 6,19 * * * /home/action/susteq/bin/activate /home/action/susteq/start.py >> /home/action/susteq/log/start.log 2>&1

다른 팁

Update: To run cron on Nitrous Pro you need to enable privileged mode on your container, which requires that you enable advanced container management. More details can be found here:

https://community.nitrous.io/docs/running-cron-on-nitrous

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top