|
Posted by burgermeister01@gmail.com on 08/20/07 16:55
On Aug 19, 5:47 pm, J. Frank Parnell <p...@edgecity.ufo> wrote:
> On Sun, 19 Aug 2007 12:38:15 -0000, "C." <colin.mckin...@gmail.com> wrote:
> >...if you are running on a POSIX type system, but you'll also need to
> >make the script executable. RTFM -http://www.php.net/manual/en/features.commandline.php
>
> >Yes you do it via a cron job if you prefer -
>
> Ok, thanks, I guess my question was more about whether my thumbnail generation
> script will choke if the cron, command line script, etc tries to run too many
> instances of it at once. I dont know how that part would work. Like if I run
> script.php?album=dir1 and dont have a way for the cron to know whether the
> script is done with dir1 before moving on to dir2.
>
> Jeez, just this one parent dir with its 3300 sub dirs is going to take around
> 100 hours.
Just to clarify on what C added to this thread: he/she is right. You
will need some script to run once and to process all the existing
images from command-line, and will probably want to just run the
routine on new, incoming images after that. If that's not a
possibility for some reason, *then* cron is the way to go.
Anyways, about cron or CLI choking: that's the reason I posted that
recursive function. You won't need multiple instances to run on each
directory, you can instead run one script that will process all
directories. Of course, like you said, this is going to take a long
time to do because you have so many images. That means you should do
these two things:
1) Be sure that you don't have any time limits set on the script's
execution time, i.e. use the function: set_time_limit(0)
2) Fully test the script before you run it on all your images. You
don't want to run the script, wait 100 hours or whatever, and then
find out that the script causes a weird distortion on some of your
files.
I hope this helps you.
Navigation:
[Reply to this message]
|