- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: CRON & CRONTAB
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
тАО03-27-2002 06:15 AM
тАО03-27-2002 06:15 AM
Opened /etc/crontab and added the following:
00,15,30,45 * * * * root /usr/xyz/script.pl
Now when cron begins it starts the perl script but it fails to open the associated files (*.cfg, *.tmp, etc). Returns an error "no such file".
In the directory xyz are the script, configuration, and template files all necessary to run the script.
I have added /usr/xyz to the path statement in crontab and in ld.so.conf. Yet the error remains.
Does someone know how to delimit the directory so that cron can execute the script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2002 08:56 AM
тАО03-27-2002 08:56 AM
Re: CRON & CRONTAB
The only diff is I use crontab with the following options and keep my cron jobs in the apropriate directories.
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
#! /bin/bash
#
# change into directory
cd /opt/dyndns
# execute script
ipcheck.py -l -v username password dnsaddress
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2002 11:42 PM
тАО03-27-2002 11:42 PM
Re: CRON & CRONTAB
kicking off a job "set > /cronenv.txt" and catting that after it runs.
-ard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2002 08:56 AM
тАО03-28-2002 08:56 AM
Re: CRON & CRONTAB
The solution developed as such from your input.
1) modify etc/crontab to read "00,15,30,45 * * * * root /usr/xyz/runscript.pl
2) runscript.pl contained the following:
# !/bin/bash
cd /usr/xyz
cd ./script.pl
Now all works correctly.
Thanks again!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2002 01:32 PM
тАО03-28-2002 01:32 PM
SolutionThe problem is that the command lines in cron are executed directly with a shell command.
The way to get around this (and a cleaner solution in your case) is to change the original cron entry to this:
00,15,30,45 * * * * root /usr/bin/perl /usr/xyz/script.pl
(provided your perl interpreter lives at /usr/bin/perl)