Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Trouble With Cron, cron trouble
Bender
post Jul 6 2003, 06:55 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 4
Joined: 6-July 03
Member No.: 1,056



Hi all
I having some trouble getting a script that I made to work properly in cron
It works fine when I run it myself in console

This script is supposed to create/update a couple of files in /tmp but does not do that when runned in cron blink.gif
The program that is used in the script, afacli is a raid command line interface

script and crontab entry follows:

crontab:
0-59/5 * * * * /root/cron

script:
#!/bin/bash

echo "Setting variables"
#
# Setting variables
#
PROGRAM=/usr/sbin/afacli
CONTROLLER=afa0
TEMPERATURE_LOG=RAID.temp
DRIVE_LOG=RAID.drives
DIRECTORY=/tmp

echo "logfile names cannot contain a path so..."
#
# logfile names cannot contain a path so...
#
cd ${DIRECTORY}
echo `pwd`

echo "remove old status files"
rm ${TEMPERATURE_LOG}
rm ${DRIVE_LOG}

echo "Generate temperature status file"
#
# Generate temperature status file
#
${PROGRAM} >/dev/null 2>&1 <<!
open/readonly ${CONTROLLER}
logfile start ${TEMPERATURE_LOG}
enclosure show temp
logfile end
exit
!

echo "Generate drive status file"
#
# Generate drive status file
#
${PROGRAM} >/dev/null 2>&1 <<!
open/readonly ${CONTROLLER}
logfile start ${DRIVE_LOG}
enclosure show slot
logfile end
exit
!




Any Ideas ?
Go to the top of the page
 
+Quote Post
Joey
post Jul 6 2003, 08:17 AM
Post #2


LinuxHelp Admin
*******

Group: Admin
Posts: 1,096
Joined: 18-September 02
Member No.: 1



Is this the full entry in your crontab:

0-59/5 * * * * /root/cron


If so, you haven't told it what program/script to run.

An example of an entry is:

52 5 * * * root /usr/local/bin/analog >> /dev/null 2>&1
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2017 - 03:57 PM