I would like to run a script between two hours using upstart:
- start at: 9h00
- stop at: 23h30
This is my upstart:
author "bakka"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
script
H_BEGIN="905"
H_END="2330"
H_NOW=$(date +%k%M)
if [[ ${H_NOW} -gt ${H_BEGIN} && ${H_NOW} -lt ${H_END} ]]; then
exec my_python_script
fi
end script
but it doesn't seems to take the condition, even if i remove the "start on runlevel [2345]"
i've already take a look here: http://upstart.ubuntu.com/faq.html#replace-cron
You'd be able to have a service only running between particular times, or on particular days, etc. Blockquote
But it's not made very clear.
If somebody knows how to specify a between time to launch something by using upstart, it would be nice.