- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: vsifax script in cron
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 05:03 AM
09-25-2002 05:03 AM
vsifax script in cron
I have written the below script and it works from the command line but has never worked in CRON.
Any ideas????
Thankyou
#################################
## Set up vsifax environment ##
#################################
VFAXDIR="/usr/vsifax/spool"; export VFAXDIR
VFAXBIN="/usr/vsifax/bin"; export VFAXBIN
VFAXMSG="/usr/stx/prog/ops/sjm/vsifax.msg"; export VFAXMSG
MAILTO="operations@ngbailey.co.uk btl.procurement@ngbailey.co.uk"
$VFAXBIN/fxstat -t | grep disabled | wc -l > /tmp/vsifax.err
LOGFILE=`cat /tmp/vsifax.err`
if [ $LOGFILE = 0 ]
then
sleep 1
else
echo "The VSI-Fax System is currently disabled" > $VFAXMSG
echo "To sort out this problem please run (as root):" >> $VFAXMSG
echo "/usr/vsifax/bin/fxshut" >> $VFAXMSG
echo "/usr/vsifax/bin/fxsched" >> $VFAXMSG
echo "/usr/vsifax/bin/fxenable fax1" >> $VFAXMSG
echo " " >> $VFAXMSG
echo "Current Status of the fax system: " >> $VFAXMSG
echo "---------------------------------" >> $VFAXMSG
$VFAXBIN/fxstat -t >> $VFAXMSG
cat $VFAXMSG | elm -s "The VSI-Fax System is currently disabled" $MAILTO
fi
rm /tmp/vsifax.err
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 05:11 AM
09-25-2002 05:11 AM
Re: vsifax script in cron
If so, try putting the following line as the fisrt line in the script:
#!/usr/bin/ksh
Also, you should define a PATH in the script. The PATH variable in .profile and /etc/profile is not sourced by cron.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 05:16 AM
09-25-2002 05:16 AM
Re: vsifax script in cron
The most common reason a script which runs from the command line does not run when initiated by 'cron' is the sparse environment that 'cron' jobs inherit. While your use of absolute path names suggests that you are aware of this, check carefully to see if their are other variables normally in your environment that your script needs.
Remember too, that the crontask is not interactive. That is, there is no terminal associated with the process. Any input which is expected from the terminal device (stdin) must therefore be accomodated by other means (redirection, etc.).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 10:22 AM
09-25-2002 10:22 AM
Re: vsifax script in cron
I.E. 0 12 * * * /path/script_to_run.sh >/tmp/cronscript.log 2>&1
-Brad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 11:08 PM
09-25-2002 11:08 PM
Re: vsifax script in cron
Thanks for the responses! I haven't yet managed to get it to work. I have had a look at /var/adm/cron/log and a * appears in the file before the script. I haven't seen this before? Could anyone tell me what it means?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 11:30 PM
09-25-2002 11:30 PM
Re: vsifax script in cron
sh: Mail: Execute permission denied.
Has anyone seen this before?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 05:06 AM
09-26-2002 05:06 AM
Re: vsifax script in cron
root runs the job.
the job runs other stuff as user vsifax.
User vsifax tries to use something only root has access to.
If it works by hand and not by cron set up a cronjob to output the environment.
ie.
58 14 * * * env > /tmp/env.incronjob
And run it by hand:
env > /tmp/env.byhand
Then....
diff /tmp/env.incronjob /tmp/env.byhand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 08:51 AM
09-26-2002 08:51 AM
Re: vsifax script in cron
One note, I try to always put the full pathname to all binaries, when writing cron scripts, for reasons mentioned already - the sparse environment.
For those that may want or need it, the script attached is intended to check the status of our fax server once an hour, and email/page me if the thing isn't normal.
I'll not claim it's well written; only that it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 08:51 AM
09-26-2002 08:51 AM
Re: vsifax script in cron
One note, I try to always put the full pathname to all binaries, when writing cron scripts, for reasons mentioned already - the sparse environment.
For those that may want or need it, the script attached is intended to check the status of our fax server once an hour, and email/page me if the thing isn't normal.
I'll not claim it's well written; only that it works.