Request cron job (Conditioned)

dragon7

Vu+ Newbie
Hi!
I am looking for help setting a cron job so it does not work when i switch my box to standby.
It looks like this now:
*/4 * * * * touch /media/hdd/keepalive.log
and it does what it is intended for but I would like that it does not do it all the time and that the hdd gets some rest while the box is on standby.
I read that I need to use if or while to condition the job to work only when the box is active/on, but I have no clue how to do it.
Any help, please...
 

dragon7

Vu+ Newbie
Hi again,
Somewhere else someone came up with this idea to keep the touch command working only when the vu+ box is active and to not work when the box is in standby, but it is not working:

-powerstate.sh
Code:
#!/bin/sh
if (wget -O - -q http://localhost/web/powerstate|grep -i false) then
touch /media/hdd/keepalive.log
fi

-crontab file to:
Code:
*/4 * * * * /root/powerstate.sh 2>&1 > /dev/null

- and
Code:
wget -O - http://localhost/web/powerstate

says:
<e2powerstate>
<e2instandby>false</e2instandby>
</e2powerstate>

Any ideas, please???
 
Top