bash Postscript delegate failed in crontab
Posted: 2013-09-05T07:09:58-07:00
Hi,
I have writen a bash script that converts files from pdf to jpg using : convert -verbose -density 400 $pdf $jpg
The bash script works perfectly when I launch it from the command line but not when I launch it from a crontab.
The bash script works if I run it from the command line as root.
I tried to add a sudo -u lbarth before the convert command without results.
I tried to add a sudo -u lbarth before the bash script in the crontab without results.
Here is the error output I get :
"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pam" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r400x400" -dUseCIEColor "-sOutputFile=/var/tmp/magick-78977DIiK_T24urq1%d" "-f/var/tmp/magick-789778Curql3jynzC" "-f/var/tmp/magick-78977iNYmPf2wliA7"
convert: Postscript delegate failed `/Users/lbarth/.../9782012457430-IN03.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/682.
convert: no images defined `/Users/lbarth/.../9782012457430-IN03.jpg' @ error/convert.c/ConvertImageCommand/3127.
The file 9782012457430-IN03.pdf exists. I thought the problem is a write permission on /var/tmp so I tried to redefine TMPDIR as mentionned in http://ghostscript.com/doc/7.07/Use.htm#Temp_files but it didn't work, ghostscript still try to write to /var/tmp.
I work on on macosx 10.8.4 with ImageMagick-6.8.6-9 and ghostscript-9.10.
What can I do ?
Regards,
Lionel
I have writen a bash script that converts files from pdf to jpg using : convert -verbose -density 400 $pdf $jpg
The bash script works perfectly when I launch it from the command line but not when I launch it from a crontab.
The bash script works if I run it from the command line as root.
I tried to add a sudo -u lbarth before the convert command without results.
I tried to add a sudo -u lbarth before the bash script in the crontab without results.
Here is the error output I get :
"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pam" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r400x400" -dUseCIEColor "-sOutputFile=/var/tmp/magick-78977DIiK_T24urq1%d" "-f/var/tmp/magick-789778Curql3jynzC" "-f/var/tmp/magick-78977iNYmPf2wliA7"
convert: Postscript delegate failed `/Users/lbarth/.../9782012457430-IN03.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/682.
convert: no images defined `/Users/lbarth/.../9782012457430-IN03.jpg' @ error/convert.c/ConvertImageCommand/3127.
The file 9782012457430-IN03.pdf exists. I thought the problem is a write permission on /var/tmp so I tried to redefine TMPDIR as mentionned in http://ghostscript.com/doc/7.07/Use.htm#Temp_files but it didn't work, ghostscript still try to write to /var/tmp.
I work on on macosx 10.8.4 with ImageMagick-6.8.6-9 and ghostscript-9.10.
What can I do ?
Regards,
Lionel