[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sidewinder
Subject:    Re: [Sidewinder] adding cron jobs
From:       sidewinder-admin () adeptech ! com
Date:       2002-10-30 23:11:07
[Download RAW message or body]

i assume that ur script runs just fine when u execute it from the admn 
role...   if it is a bourne shell script, does it have "#!/bin/sh" as the 
first line?   also, consider redirecting script output to a log or to 
/dev/null.   here is an example cron entry for a script that redirects all 
output to /dev/null:

*/5 * * * * root Admn /root/scripts/whatever.sh > /dev/null 2>&1

and within the script, i redirect output to a debugging log (note the ">> 
$LOG" standard-out redirections after specific commands):

#!/bin/sh

LOG=/var/log/whatever.log
DATE=`date +%Y-%m-%d\ %T` 
COUNT=0
MAX_COUNT=10

echo "** $0 started $DATE **" >> $LOG

while [ $COUNT -lt $MAX_COUNT ]
do
     COUNT=$(($COUNT + 1))
     echo "time waster $COUNT" >> $LOG
     sleep 1
done

# end

this is only a house-keeping issue, but i recommend that u don't put custom 
scripts under /etc.   put them into either ur home directory, under /root 
(like /root/scripts), or under /usr/local/bin.   keeping customizations 
centralized will ease backups/restores/upgrades and troubleshooting.

randy blahut
rblahut@aol.com

[Attachment #3 (text/html)]

<HTML><FONT FACE=arial,helvetica><FONT COLOR="#000000" FACE="Geneva" \
FAMILY="SANSSERIF" SIZE="2">i assume that ur script runs just fine when u execute it \
from the admn role...&nbsp;  if it is a bourne shell script, does it have "#!/bin/sh" \
as the first line?&nbsp;  also, consider redirecting script output to a log or to \
/dev/null.&nbsp;  here is an example cron entry for a script that redirects all \
output to /dev/null:<BR> <BR>
*/5 * * * * root Admn /root/scripts/whatever.sh &gt; /dev/null 2&gt;&amp;1<BR>
<BR>
and within the script, i redirect output to a debugging log (note the "&gt;&gt; $LOG" \
standard-out redirections after specific commands):<BR> <BR>
#!/bin/sh<BR>
<BR>
LOG=/var/log/whatever.log<BR>
DATE=`date +%Y-%m-%d\ %T` <BR>
COUNT=0<BR>
MAX_COUNT=10<BR>
<BR>
echo "** $0 started $DATE **" &gt;&gt; $LOG<BR>
<BR>
while [ $COUNT -lt $MAX_COUNT ]<BR>
do<BR>
&nbsp;&nbsp;&nbsp;&nbsp; COUNT=$(($COUNT + 1))<BR>
&nbsp;&nbsp;&nbsp;&nbsp; echo "time waster $COUNT" &gt;&gt; $LOG<BR>
&nbsp;&nbsp;&nbsp;&nbsp; sleep 1<BR>
done<BR>
<BR>
# end<BR>
<BR>
this is only a house-keeping issue, but i recommend that u don't put custom scripts \
under /etc.&nbsp;  put them into either ur home directory, under /root (like \
/root/scripts), or under /usr/local/bin.&nbsp;  keeping customizations centralized \
will ease backups/restores/upgrades and troubleshooting.<BR> <BR>
randy blahut<BR>
rblahut@aol.com<BR>
</FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2"></FONT></HTML>


_______________________________________________
Sidewinder mailing list
Sidewinder@adeptech.com
http://mail.adeptech.com/mailman/listinfo/sidewinder

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic