Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I don't know anything about what "/usr/bin/feh" does or how it works. I've never heard of it before. But you say you are able to run it (and run the perl script that runs it via "system()") using your shell (though not via cron). So I'm hoping you know what it does.

If you do the shell command "env" (which will list all your environment variables), do you see anything that seems to relate to this "feh" program (e.g. any variables that have "feh" or "FEH" as part of the variable name)? Is there a man page for "feh" that explains the environment setup for using it?

If, for example, your normal login-shell environment includes a variable like FEH_CONFIG=... then your perl script just has to include a line like:

$ENV{FEH_CONFIG} = ...;
to match whatever is in your shell environment. The point is that cron only runs jobs under a limited shell, leaving out a lot of settings that you might take for granted in your interactive login sessions.

Just for grins, try running a cron job that just does "env", to see what is in your run-time environment under cron. Or if you like, you could have cron run a perl script like this:

#!/usr/bin/perl print "$0: Environment\n"; print " $_ = $ENV{$_}\n" for ( sort keys %ENV );
Comparing that output to what you get from an interactive shell might be informative.

In reply to Re^3: system call in crontab by graff
in thread system call in crontab by naildownx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2022-08-19 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?