Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by flieckster (Scribe)
on Apr 02, 2019 at 01:14 UTC ( [id://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 (Monsignor) 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?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-19 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found