Domanda

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     
È stato utile?

Soluzione

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

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top