RSS/Atom feed Twitter
Site is read-only, email is disabled

Running a batch script, failing under cron

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

1 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

20050426190249.F3FF610E9F@l... 07 Oct 20:23
  Running a batch script, failing under cron Dov Kruger 26 Apr 21:58
Dov Kruger
2005-04-26 21:58:18 UTC (almost 19 years ago)

Running a batch script, failing under cron

We are running a conversion script in gimp 1.2 under RedHat Enterprise Edition 3. If we run the perl script interactively, it works. However, when run in cron, it does not, though it worked under cron on another production server running RedHat 7. It appears that the reason is that cron fails to find the script, but I cannot prove that. It simply doesn't do anything in gimp, and returns without any displayed error message.

Perhaps we should be using 2.0, but installation has always been a massive headache, and we get incomplete installs due to failures in the print libraries, the only solution that I got a response about was building without printing, so I'd prefer to make this work with our existing setup, unless someone is feeling like being particularly helpful and resolving this ongoing problem with gimp builds for us.

While we're at it, if you notice any massive inefficiencies in our script, I'd love to make it run faster, since it is executed 3000 times a day, soon to be 6000, then 24000.

The following file is the gimp script, which works both under gimp-2.0 and gimp-1.2:

(define
(dl-png2transindexed2 file)
(let*
(
(img (car
(file-png-load 1 file file)
)
)
(d (car (gimp-image-active-drawable img))) )
(gimp-layer-add-alpha (car (gimp-image-get-active-layer img))) (gimp-by-color-select d '(255 255 255) 0 2 0 0 0 0) (gimp-edit-clear d)
(gimp-convert-indexed img 0 0 255 0 0 "") (file-png-save 1 img d file file 0 6 0 0 0 1 1) (gimp-image-delete img)
)
)

(script-fu-register "dl-png2transindexed2" "/Xtns/Script-Fu/png2transindexed2"
"png2indexed2"
"Dov Kruger& Elena Zagrai"
"(c) 2004 Stevens Institute of Technology" "2004-02-25"
""
SF-FILENAME "File" "file.png"
)

A test shell script that illustrates the problem with cron:

#!/bin/sh echo 'foo'
/usr/bin/gimp --no-splash --console-messages --no-interface -b '(dl-png2transindexed2 "T26nyharaspeedtop.png")' '(gimp-quit 0)' echo "bar"