WebFaction
Community site: login faq

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
115
accept rate: 0%

edited 14 Jan '17, 14:38

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

(14 Jan '17, 14:14) nik

Thanks, I solved the [UPDATE] part with the @INC lib adding use lib "/home/USER/perl5/lib/perl5";

but the problem of -bash: bin: command not found

still persists :/

(14 Jan '17, 14:36) simonquasar

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.

(14 Jan '17, 14:58) nik
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×81
×57
×50

question asked: 14 Jan '17, 12:26

question was seen: 1,356 times

last updated: 14 Jan '17, 14:58

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM