PDA

View Full Version : cron job under linux



clockhar
06-08-2002, 10:23 AM
I am trying to set up a cron job that runs at night (or whenever I am not around) to start the folding client. I know how to set it up to run at certain times, but how do I go about killing the client without losing data. i.e. if you run the client and press ctrl-c (instead of q), the client closes down without saving/sending the data (that is what I understand anway - correct me if I'm wrong). So, is there anyway I can send a "safe" kill command automatically or somehow pipe 'q' to a program running in the background?

Jodie
06-08-2002, 11:50 AM
I haven't thought this through a lot, but you know - that's a really good question.

It seems like catching a particular signal as a valid quit might be super-cool.

Howard - am I off-base, or would trapping on - let's say SIGHUP and taking that as a valid exit be uncool for some reason?

Then closing the window or doing a kill -HUP [process] would cause a clean exit.

Should be trivially easy. (unlike posix in be. :rolleyes @self) ;)

Digital Parasite
06-08-2002, 12:11 PM
To safely shut down the process on Linux you can just have your cron script delete foldtrajlite.lock which tells the client to stop after it finishes the current structure. That way you know it will shutdown properly (if you are online it will also upload the stored results too).

Jeff.

Jodie
06-08-2002, 12:23 PM
Yup. That's a good point, and I do that now with them. Sending a signal to the client is somewhat easier than deleting the file, by hand. Although I could just make a hard-path system accessible shell script and call it kdf or somesuch... Just as easy. Okey, I retract my request... ;)

clockhar
06-09-2002, 12:32 AM
Woah, deleting the .lock file? I would never have even guessed that. Well, it works! ... Thanks all for the help

Brian the Fist
06-09-2002, 10:56 AM
RTFM :p