Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

comment on

( [id://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:

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

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 How to display code and escape characters are good places to start.