Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: perl script in nohup running from crontab

by tanuj (Novice)
on Sep 23, 2011 at 09:26 UTC ( [id://927514]=note: print w/replies, xml ) Need Help??


in reply to Re: perl script in nohup running from crontab
in thread perl script in nohup running from crontab

Thanks graff,

cron is executing the script, but now i have a different problem.

I have all the scripts under /root/nfs_share/SCRIPTS folder as you can see i was trying to run a script ncp_run.tcl (which is again under SCRIPTS dir). In this ncp_run.tcl file i am socurcing some other files

source resource.conf source init.tcl

so while corn is executing the script it is throwing error
couldn't read file "resource.conf": no such file or directory while executing "source "resource.conf"" (file "/root/nfs_share/SCRIPTS/ncp_run.tcl" line 1)
so is it something like corn is running this in some other environment. here is some of the datails:

[root@perflnx14 SCRIPTS]# which crontab /usr/bin/crontab [root@perflnx14 SCRIPTS]# echo $SHELL /bin/bash [root@perflnx14 SCRIPTS]# echo $PATH /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/s +bin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/nfs_share/SCRIPTS:/root/n +fs_share/SCRIPTS/ [root@perflnx14 SCRIPTS]# echo $HOME /root

but if i run this script manually  expect -f ncp_run.tcl</it will work finep> once again thanks for helping me out in this ;-)

Replies are listed 'Best First'.
Re^3: perl script in nohup running from crontab
by hbm (Hermit) on Sep 23, 2011 at 12:51 UTC

    When you log in, your profile is loaded, paths are defined, etc. That does not happen with cron.

    So, when cron'ing, explicitly define the full path for every file you open.

Re^3: perl script in nohup running from crontab
by graff (Chancellor) on Sep 23, 2011 at 23:24 UTC
    As indicated by hbm above, the next thing to try is to edit the contents of "nap_run.tcl":
    source /root/nfs_share/SCRIPTS/resource.conf source /root/nfs_share/SCRIPTS/init.tcl
    It's curious that your "nap_run.tcl" file is actually being used/interpreted as a (ba)sh shell script, despite the fact that the ".tcl" extension would lead a casual observer to think that it's actually a tcl script instead. Is it your intention to use the ".tcl" extension on shell scripts? And if "resource.conf" and "init.tcl" don't start with shebang lines, is it your intention that they are also used/interpreted as shell scripts?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://927514]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-23 15:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found