Fold/Pause/Finish from command line?

If you're new to FAH and need help getting started or you have very basic questions, start here.

Moderators: Site Moderators, FAHC Science Team

Post Reply
dr_bees
Posts: 3
Joined: Thu Feb 18, 2021 6:15 pm

Fold/Pause/Finish from command line?

Post by dr_bees »

I'm looking to finish all running jobs at the end of the day and then start again in the morning. My pets sleep in the same room as my PC and I think the fan noise from folding all night has been disturbing them. The fan speed tends to ramp up and down somewhat unpredictably during folding.

I was hoping I could just use a cronjob to tell FAH to finish in the evening and start folding again in the morning, but I don't really see a command line interface for FAHControl. I'm running linux.

Any suggestions?
Joe_H
Site Admin
Posts: 7871
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Fold/Pause/Finish from command line?

Post by Joe_H »

Welcome to the folding support forum.

There are several ways to approach this. There is a defined API for communicating with the F@h client - https://github.com/FoldingAtHome/fah-co ... Client-API. That can be used to program an app if you want.

As mentioned on the page, you can use telnet or the equivalent to connect to the running FAHClient process and directly enter commands. For example on my Mac's I use the nc (netcat) command to do this since telnet was removed in later versions of the OS.

You can also use the FAHClient command on the command line as well. Use FAHClient --help to see all commands, you would use FAHClient --send with a command such as pause or finish you want to be sent to the running FAHClient process in the background.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
dr_bees
Posts: 3
Joined: Thu Feb 18, 2021 6:15 pm

Re: Fold/Pause/Finish from command line?

Post by dr_bees »

I've answered my own question looking elsewhere on the forum. Putting the answer all in one place in case it helps anyone else.

You need to use the telnet interface. (eg:

Code: Select all

telnet 127.0.0.1 36330
starts interactive telnet session. in the session, enter "help" to get a list of commands)
You can get the port number in FAHControl GUI -> configure -> connection. Mine is the default of 36330.

My situation is simple, since I have only one client running locally.

Code: Select all

echo -e "finish\nquit\n" | telnet 127.0.0.1 36330

Code: Select all

echo -e "unpause\nquit\n" | telnet 127.0.0.1 36330
works like a charm!
dr_bees
Posts: 3
Joined: Thu Feb 18, 2021 6:15 pm

Re: Fold/Pause/Finish from command line?

Post by dr_bees »

Joe_H wrote:Welcome to the folding support forum.

There are several ways to approach this. There is a defined API for communicating with the F@h client - https://github.com/FoldingAtHome/fah-co ... Client-API. That can be used to program an app if you want.

As mentioned on the page, you can use telnet or the equivalent to connect to the running FAHClient process and directly enter commands. For example on my Mac's I use the nc (netcat) command to do this since telnet was removed in later versions of the OS.

You can also use the FAHClient command on the command line as well. Use FAHClient --help to see all commands, you would use FAHClient --send with a command such as pause or finish you want to be sent to the running FAHClient process in the background.
Whoops, didn't see this while I was working on my answer. Nice to know there's multiple ways to do this! Thank you :)

Edit:

Code: Select all

FAHClient --send-finish 
and

Code: Select all

FAHClient --send-unpause
are definitely the cleaner option. Thanks Joe!

Edit again:
I'm actually using pause and unpause, since I forgot that sometimes jobs can take hours to wrap up. I was just worried about the jobs timing out but I think I'll be fine.
Post Reply