I have a problem that I just don't get...
I use boutell.com's program webthumb, that makes thumbs from websites by opening Mozilla in a Xvfb and copies the content to a PPM-file.
If Xvfb is not started, it automatically starts this, and the same with Mozilla. I have modified the program slightly so it also adds a row to a database.
When I run this program as root, everything works fine, the thumb is created as a jpg and database is written.
But when I add this as a crontab job for root, it doesn't work. The database gets written to, but the thumb is not created. How can this be? Is there some difference between running Xvfb as root or as Crontab root?
The script that is run from crontab is a PHP-script that calls a Perl-script using function "passthru".
The Perl script just takes a couple of commands and forwards them to boutell's webthumb.
Boutell.com's webthumb script can be looked at here.
Thanks in advance from a confused
Masali
I use boutell.com's program webthumb, that makes thumbs from websites by opening Mozilla in a Xvfb and copies the content to a PPM-file.
If Xvfb is not started, it automatically starts this, and the same with Mozilla. I have modified the program slightly so it also adds a row to a database.
When I run this program as root, everything works fine, the thumb is created as a jpg and database is written.
But when I add this as a crontab job for root, it doesn't work. The database gets written to, but the thumb is not created. How can this be? Is there some difference between running Xvfb as root or as Crontab root?
The script that is run from crontab is a PHP-script that calls a Perl-script using function "passthru".
The Perl script just takes a couple of commands and forwards them to boutell's webthumb.
Code:
#!/usr/bin/perl
if (int(@ARGV) != 4) {
die "Usage: makethumb [URL] [Max Width] [Max Height] [Filename (without .jpg)]\n";
}
my $url = $ARGV[0];
my $w = $ARGV[1];
my $h = $ARGV[2];
my $f = $ARGV[3];
my $sys="./webthumb $url | pnmcut -top 108 -left 3 -right 1005 -bottom 990 | pamscale -xyfit $w $h | pnmtojpeg > thumbs/$f.jpg";
system($sys);
Boutell.com's webthumb script can be looked at here.
Thanks in advance from a confused
Masali