Re: [ADMIN] cron script

From: Mark A. Heilpern (heilpern@MINDSPRING.COM)
Date: 12/15/97


At 11:30 PM 12/14/97 -0500, you wrote:
>At 01:25 PM 12/9/97 -0600, you wrote:
>>My crontab entry:    ("crontab -e" to make yours)
>>-------------------------------------------------
>>*/5 * * * * /home/mud/mudchk
>>
>
>Thanks a lot for this, 'tis very very very helpful. Just out of curiosity,
>I did just have to ask specifically what the */5 was for (*am assuming any
>number divisible by 5 properly will execute, ie, every 5 mins.*)
>

That notation does make the script run every 5 minutes as you assume, and is
much nicer looking than 0,5,10,....    The same notation can be applied to
other fields in the entry.


ObCircle:

I added this line to my autorun script, just after the syslog tail is copied
to syslog.CRASH:
   gdb -q -x core_decode bin/circle lib/core >> syslog.CRASH 2>&1 </dev/null

core_decode is a text file in the same directory, which looks like this:
   printf "\n------------------------------------------------------------\n"
   printf "Last command was: %s\n", last_command
   printf "Executed by %s in room #%d\n", last_commander->player.name,
world[last_commander->in_room].number
   quit

I added globals last_command and last_commander in interpretter.c:
   char last_command[MAX_INPUT_LENGTH];
   struct char_data *last_commander;

and somewhere in there, after a command is entered, i assign them:
   last_commander = ch;
   strcpy(last_command, argument);


Now, after a crash, I get output in syslog.CRASH that tells me the function
and
location the mud was in at the time of the crash, and who most recently did
what
and where.

It isn't useful for all crashes, of course, but even if you don't know gdb
well
enough to perform post-mortem debugging, this will help you analyze many
crashes
after the fact.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST