Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

scheduled perl script on cron but not executing completely in background..

by sakshi (Initiate)
on Sep 10, 2016 at 18:02 UTC ( #1171520=perlquestion: print w/replies, xml ) Need Help??

sakshi has asked for the wisdom of the Perl Monks concerning the following question:

i am using perl script which is scheduled on crontab..its running but in nohup.out file getting blank values..

#!/usr/bin/perl use DBI; use POSIX; $serip=`ifconfig |grep 'inet addr'`; @serip=split('\n', $serip);@serip=split(' ',$serip[0]);$sip=$serip[1]; +@serip=split('\.',$serip[1]); $sid=$serip[3]; $sip =~ s/addr://; print "ServerIP : $sip ServerID= $sid\n";
  • Comment on scheduled perl script on cron but not executing completely in background..
  • Download Code

Replies are listed 'Best First'.
Re: scheduled perl script on cron but not executing completely in background..
by Corion (Pope) on Sep 10, 2016 at 18:21 UTC

    crond does not write to nohup.out.

    Usually, crond sends you an email with the output of your script after it has run to completion.

Re: scheduled perl script on cron but not executing completely in background..
by fullermd (Priest) on Sep 11, 2016 at 03:04 UTC

    cron runs with its own $PATH, which on many systems doesn't include /sbin, which is where ifconfig usually is. So is it even running ifconfig? Try a full path.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1171520]
Approved by beech
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2020-11-26 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?