Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Help.

Status
Not open for further replies.

jdhinze

MIS
Jul 14, 1999
35
US
Must be a Monday !! I am having problems with the following script . The script runs correctly when I manually run the script.
When I put the script in a cron Job It kicks out at the @ MP=$MN / 6 . For some reason it does not like the @ MP =$MN /6. Is there antoher way rto write this in order for it to work correctly in a cron job?

Thanks in advance,
I guess I just had tooomuch fun this weekend brain is not working.






# !/bin/csh

# set variables for login devices
set PMA = "pm1"
set PMB = "pm3"

#get a count for the number of users , excluding dedicated users.
set PA = `/usr/local/bin/pmwho $PMA |grep -v W1|grep -v Port|grep -v "[-]"|wc -l`
set PB = `/usr/local/bin/pmwho $PMB |grep -v W1|grep -v -v Port|grep -v "[-]"|wc -l`

# Set time and date variables
set HR = `/bin/date '+%H'`
set MN = `/bin/date '+%M'`
set DT = `/bin/date '+%m/%d/%y'`
set BX = `/bin/date '+%m'`
set BY = `/bin/date '+%y'`
set BZ = `/bin/date '+%d'`



# Convert the minutes into percentage format for easier handling
@ MP=$MN / 6


# Start a new file if it is midnight
if ($HR == 00 && $MN <= 09 ) then
cat /dev/null > /usr/local/pm/pm1.log
cat /dev/null > /usr/local/pm/pm3.log
endif

# Put the numbers into the log file.

echo $HR&quot;.&quot;$MP &quot; &quot; $PA &quot; &quot; >> /usr/local/pm/pm1.log
echo $HR&quot;.&quot;$MP &quot; &quot; $PB &quot; &quot; >> /usr/local/pm/pm3.log
endif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top