Page 1 of 1

restrict time-of-day when fah runs

Posted: Fri Jun 14, 2013 4:56 pm
by argonaut
Is it possible to configure the FAH client so that it only runs during certain hours, and is idle the rest of the time? Thanks!

Re: restrict time-of-day when fah runs

Posted: Fri Jun 14, 2013 5:03 pm
by 7im
Run fahclient from a scheduled task in a command line. Since Windows has always had this feature, there was no need to add it in to fah.

Run fahclient full time in one task, for certain hours. Then set to run Only when Idle for other certain hours in a 2nd task.

Re: restrict time-of-day when fah runs

Posted: Fri Jun 14, 2013 5:31 pm
by argonaut
What about MacOS?

Re: restrict time-of-day when fah runs

Posted: Fri Jun 14, 2013 5:45 pm
by bruce
Unix variants (including both Linux and probably OS-X) should allow services to run at scheduled times, though it'll probably take a programmer to set it up properly for you.

There's an open ticket suggesting an enhancement (#300) but it has been languishing, waiting for enough development time to add lower priority items to the client.

Re: restrict time-of-day when fah runs

Posted: Fri Jun 14, 2013 5:50 pm
by Napoleon
<edit>
Telnet is pretty universal, so something to this effect should be available for all operating systems. Windows has a built-in scheduler, Linux has cron. I'm clueless about Macs, but something like the above two just got to be there. Quick googling yielded http://macscripter.net/viewtopic.php?id=36932.
The following example is for Windows. Just tried it myself with v7.3.6 (except for the actual scheduling part). Seems to do the job.
</edit>

EDIT2: Huh, feeling rather dumb right now, I completely forgot that one can simply use the FahClient command line the way calxalot explained. One good thing about telnet, though: you can pause remote clients from a single controlling machine.

Not directly, but it's possible by using 3rd party methods. For example, the FAHClient listens to (default) port 36330 for telnet, so you could create pause/unpause scripts and put those in Windows scheduler. So, http://jerrymannel.com/blog/2008/11/11/ ... -tst10exe/ and schedule something like "tst10 /r:pause.txt /m" & "tst10 /r:unpause.txt /m".

pause.txt example (pauses slot 2, pause without parameter pauses all slots):

Code: Select all

localhost 36330
SEND "\m"
WAIT ">"
SEND "pause 2\m"
WAIT ">"
SEND "exit\m"
unpause.txt example (reverse of pause.txt):

Code: Select all

localhost 36330
SEND "\m"
WAIT ">"
SEND "pause 2\m"
WAIT ">"
SEND "exit\m"

Re: restrict time-of-day when fah runs

Posted: Fri Jun 14, 2013 6:24 pm
by calxalot
Easiest thing would probably be to just leave the client running, and send pause/unpause commands via cron.
Like, at 8am run FAHClient --send-pause and at 8pm run FAHClient --send-unpause.
man crontab
There are gui apps to modify your crontab if you don't want to do it by hand from the terminal. Eg CronniX.

On OSX, if you're worried about the small amount of cpu time the client uses even when idle, you might modify the launchd plist that starts the client.
man launchd.plist

If these are user machines, instead of pausing during work hours you might want to use the idle power level.

If you're not using an idle folding power level, you can reduce the client's cpu usage some by setting client option idle-seconds 0 (zero) in FAHControl.

Re: restrict time-of-day when fah runs

Posted: Fri Jun 14, 2013 7:27 pm
by argonaut
Thanks for all the suggestions!
It would still be useful if this was a simple setting in FAHControl, but looks like that request is already in the database.