Hello everybody,
I am trying to run a script (downloaded from GitHub) which should generate PNGs images with Python via Cron Job, which looks like this
*/2 * * * * /home/USER/webapps/maps/bigmap_download.pl
2 */6 * * * /home/USER/webapps/maps/purge_images.pl
So I tried also to run it manually with:
* * * * * crontest /usr/local/bin/php/home/USER/webapps/maps/bigmap_download.pl
* * * * * crontest /usr/local/bin/php/home/USER/webapps/maps/purge_images.pl
While the directories are set up with the proper mode (755 or 777), the job isn't done.
But i get a Code 127 fail and also a
-bash: line 10: backup.tgz: command not found
Where "backup.tgz" is just the first file he founds in the directory listing (tried also with other paths, and get just the first file in the dir again)
The only var where I am not sure if it's correct is the absolute path I should use in purge_images.pl
my $path = '/home/USER/webapps/maps/www/result';
but tried several other combinations, not working, as well.
I can't find any error logs for this, a /user/cron.log
is missing and am not able to follow the error.
So, for now I don't think it's really in the code, but maybe some setup on the Webfaction server and/or the Cron which I miss?
[UPDATE]
I tried to run the bigmap_download.pl
via Putty SSH console and I get a more generic
~/webapps/maps/bigmap_download.pl
Can't locate GD.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/USER/webapps/maps/bigmap_download.pl line 12.
BEGIN failed--compilation aborted at /home/USER/webapps/maps/bigmap_download.pl line 12.
on line 12 of the file
use GD;
[This part has been solved with use lib "/home/USER/perl5/lib/perl5";
before the use GD;
statement]
[/UPDATE]
Thanks in advance for any suggestion,
Simon
asked
14 Jan '17, 12:26
simonquasar
11●1●5
accept rate:
0%
The scripts you are running are not Python but Perl (!) scripts.
Maybe this helps... http://stackoverflow.com/questions/16877777/how-can-i-get-my-perl-program-to-access-gd
Thanks, I solved the [UPDATE] part with the
@INC
lib addinguse lib "/home/USER/perl5/lib/perl5";
but the problem of
-bash: bin: command not found
still persists :/
inside your cron file and in each line, maybe you should prefix your scripts calls with the Perl interpreter, i.e instead of
*/2 * * * * /home/USER/webapps/maps/bigmap_download.pl
do a*/2 * * * * /usr/local/bin/perl /home/USER/webapps/maps/bigmap_download.pl
To ensure that the path to the interpreter is correct, do:
which perl
.