MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: crontab entry to check for dead Minivend server



******    message to minivend-users from Frank Miedreich <miedreich@acm.org>     ******

>******    message to minivend-users from "Thompson-Jordan"
><Thompson-Jordan@mindspring.com>     ******
>
>While reading the expireall -r messages, I was was thinking of other
>things I would like in crontab and wondering if anyone has done anything
>like:
>
>- script that checks if the Minivend server is running and runs restart it
>if it isn't
>
>- script that would safely move the log files to another directory, maybe
>adding the date to the name, effectively clearing them and making the old
>logs available to parse offline.
>
>
>Christopher Thompson
>

the first script you suggest is in mvend/bin/checkstat.sh

to rotate the log files I use:

#!/bin/sh

# rotates log files
# This can be run as a cron script

DATE=`date +%h-%y`
CATDIR='/home/kmied/catalogs'

# Add here any catalogs.
CATALOGS='cat1 cat2 cat3'

# Add here any logfiles.
LOGS='error.log'


(cd $CATDIR;

 for c in $CATALOGS; do
   cd $c;
   for i in $LOGS; do
     if [ -f $i ]; then
       mv $i $i.$DATE
     fi
   done
   cd ..;
 done)

Cheers, Frank

--
Frank Miedreich
Max-Planck-Institut fuer psychologische Forschung


-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: