Hi,

If you run something from cron with short period it's wise to ensure
that every instance terminates before the next is started.
Perhaps you need to implement an alarm killing for your script like
this one: 
http://www.woodwose.net/thatremindsme/2011/05/forking-parallel-processes-in-bash/
Or using Perl: 
http://www.cyberciti.biz/faq/shell-scripting-run-command-under-alarmclock/


On Wed, Jul 18, 2012 at 9:05 AM, David <[email protected]> wrote:
>
> root@ns:~ # cat /etc/cron.minute/background
> #!/bin/bash
> # mv a random background pic for website
> # images must be named 1.jpg 2.jpg ..... NUMFILES.jpg
>
> DIR=/var/www/html/sks.com/images
> NUMFILES=`ls $DIR/backgrounds/*.jpg | wc -l`            # no. of images
> let "i=($RANDOM%$NUMFILES)+1"
> cp $DIR/backgrounds/$i.jpg $DIR/backgroundimage.jpg     # cp to CSS location
>



-- 
http://www.dataparksearch.org/  Twitter: @Maxime2
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to