X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=html%2Fcron.html;h=d4f82f46b81d858f8e852af1608ee76c59ab7a5c;hb=f63d598af3f797b56b8d5e23ec4ff5254192eee9;hp=adb9320ace09d7912c189db7ff1b7bfefe16bc2b;hpb=f3adc82a0299652d929b73c718127fa38571eec5;p=spider.git diff --git a/html/cron.html b/html/cron.html index adb9320a..d4f82f46 100644 --- a/html/cron.html +++ b/html/cron.html @@ -2,11 +2,12 @@ Crontab - doing things periodically - + + @@ -21,7 +22,7 @@

-Last modified: Mon Dec 28 01:06:43 GMT 1998 +Last modified: Mon Apr 23 01:00:44 BST 2001

Introduction

@@ -73,9 +74,14 @@ Last modified: Mon Dec 28 01:06:43 GMT 1998 to another cluster and a set of routines are specially provided in the context of the DXCron package to make this easy. For example
+  start_connect('gb7tlh') unless connected('gb7tlh')
+    
+ this could have also been written: +
   start_connect('gb7tlh') if !connected('gb7tlh')
     
- will attempt to start a connection process to GB7TLH if it isn't + but the first method is more 'perlish', +

Either of these commands will attempt to start a connection process to GB7TLH if it isn't already locally connected.

There is absolutely no reason why you could not do something more complicated using information @@ -92,7 +98,7 @@ Last modified: Mon Dec 28 01:06:43 GMT 1998 # check every 10 minutes to see if gb7tlh is connected and if not # start a connect job going - 0,10,20,30,40,50 * * * * start_connect('gb7tlh') if !connected('gb7tlh') + 0,10,20,30,40,50 * * * * start_connect('gb7tlh') unless connected('gb7tlh') # at 03:15 on Sundays start a job called 'analyse.pl' which does something # or other. This starts a new process and runs to completion, be careful @@ -106,12 +112,32 @@ Last modified: Mon Dec 28 01:06:43 GMT 1998 # the values for mycall and version 15,30 * * * spawn("echo $main::mycall is a DXSpider Version $main::version DX Cluster system") + + # then there is always the highly contentious one like this little jem which + # checks every hour to see if a certain callsign is connected to another cluster + # and silently disconnects him. This is an example only (of course...) + + 23 * * * * rcmd('rcmd/gb7dxm disc/noinform G9TLH') if present_on('G9TLH', 'GB7DXM') + + # some people like to do an hourly announce to say who they are. There is a + # slight complication about this because of the announce duplicate checking + # so you need to make each announce unique. I do this by adding a date and time + # stamp on the end + + 0 * * * * run_cmd('ann CLUSTER: GB7DJK JO02LQ at ' . cldate . ' ' . ztime) + It is important remember that these crontab routines execute in line with the main - cluster code, so if you create a long, slow crontab commands, it will impact on the speed + cluster code, so if you create a long, slow crontab command, it will impact on the speed and usability of the cluster as a whole. +

If you want to see what commands are being run and/or the syntax errors in the + crontab, then run: set/debug cron on the console and monitor the + debuging output (I use watchdbg in another window). + +

To set the debugging back to normal do: unset/debug cron. +

Standard Routines

As mentioned earlier, there are a small number of routines that are declared in DXCron @@ -119,26 +145,34 @@ Last modified: Mon Dec 28 01:06:43 GMT 1998 They are:- -

Caveats

- - There seems to be an intermittent problem when running - (especially?) with the debugger on. Essentially you will - experience random crashes with nonsensical error messages. I - believe that this is caused by stack tracing trying to work inside - forked processes. -