Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Perl Script works when i run in terminal, not via cron

by flieckster (Scribe)
on Apr 02, 2019 at 01:14 UTC ( #1231967=perlquestion: print w/replies, xml ) Need Help??

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

can anyone let me some wisdom as to where to start with this? i have a perl script that finds filenames, in a directory, then calls a URL to get some custom meta data, then uses the system command to call exiftool and the url string with filename to add metadata to the file it called earlier. the script works fine when i run it from terminal, but when i set up the cron it just doesn't seem to work. i feel like its getting caught at system ("exiftool $variables_from_URL); anyone know where to begin to diagnose? my cron also looks like this #*/2 * * * * /usr/bin/perl /Volumes/.../exiftool.pl thank you

Replies are listed 'Best First'.
Re: Perl Script works when i run in terminal, not via cron
by tybalt89 (Prior) on Apr 02, 2019 at 01:33 UTC

    Usually because the $PATH is different under cron. Try using full path names in the system call.

      actually that did it, thank you so much!
      like /usr/local/bin/exiftool?
Re: Perl Script works when i run in terminal, not via cron
by ig (Vicar) on Apr 02, 2019 at 01:59 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1231967]
Approved by haukex
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2022-06-28 13:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (91 votes). Check out past polls.

    Notices?