This is my trouble. I read and read again Batch job page, but I couldn't find the right syntax for the simpler case: simply, how to run a /single/ script using batch job! Examples deal mainly with cron jobs: but how can I run a /single/ script like, even in into an interactive way to test it, ie:
The cronjob just triggers your batch job, so you can use the same commands in shell as in cron. But the command
/python example.py/
has now to be runned this way:
cronsub example.py
'cronsub' is just the "better" version to start a job than 'qsub' especially for python scripts. You have also to make the .py file executable which means use 'chmod 744' on it and add '#!/usr/bin/env python' as first line to your example.py file. May be you want to confer the mails on this list between Jan. 8. and Jan. 9. about this topic.
Next question. I'd like to run again my irc.py python script, designed to run into a screen forever. I can't understand why I'd wrap it into a crontable: it has simply to run once. When it was running, I run it into a screen simply with:
I don't know if you have to - the same procedure as you used should still work and also be ok... But when reading first [1] (even if its obsolete now) and then [2] you can see there is THE ADVANTAGE of having your script automatically re-started once the server re-starts (else your script is down until you start it again by hands). The other advantage is you won't have to use 'screen' in fact since this is to keep your script running by the moment you log out - but since the server runs your script this is not needed anymore. (I also used to use 'screen' to have my bot running all the time, most of it in 'sleeping' state, but it is much more convenient to re-write it in a way you can run it by cron, at a given interval, e.g. all 10 minutes... EXCEPT YOU HAVE to have a continous running one, e.g. to log the whole irc messages or else... ;)
May be someone else has some additional tips... But the toolserver wiki is a good place to start...
[1] https://wiki.toolserver.org/view/Phoenix [2] https://wiki.toolserver.org/view/Job_scheduling#Converting_a_Phoenix_tool_to...
Am 14.01.2011 10:05, schrieb Alex Brollo:
2011/1/14 Dr. Trigon <dr.trigon@surfeu.ch mailto:dr.trigon@surfeu.ch>
It should be (rather) simple once you got how 'crontab'/'cronjob's work.
This is my trouble. I read and read again Batch job page, but I couldn't find the right syntax for the simpler case: simply, how to run a /single/ script using batch job! Examples deal mainly with cron jobs: but how can I run a /single/ script like, even in into an interactive way to test it, ie:
/python example.py/
Next question. I'd like to run again my irc.py python script, designed to run into a screen forever. I can't understand why I'd wrap it into a crontable: it has simply to run once. When it was running, I run it into a screen simply with:
/python irc.py/
It simply listens at it.source #irc Recent changes channel, and writes selected & parsed data into a public txt file (so I can see from web if it's live or dead without logging into the server, and there's too a queue ready for another cron script, who uses that txt file)
How should I run it into a screen, with new settings? Remember... I'd like an idiot-proof suggestion. :-(
Alex
Toolserver-l mailing list (Toolserver-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/toolserver-l Posting guidelines for this list: https://wiki.toolserver.org/view/Mailing_list_etiquette