FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 07-12-2011, 03:07 AM
Les Mikesell
 
Default Triggering script from cron or web client

On 7/11/11 9:16 PM, Kenneth Porter wrote:
> --On Friday, July 08, 2011 8:23 PM -0400 Brian Mathis
> <brian.mathis+centos@betteradmin.com> wrote:
>
>> If you don't want to wait a full minute you could use
>> 'incron' to monitor the temp directory and kick the update right away.
>> Seems better than having something in a loop constantly checking.
>
> incron sounds promising. I could use the regular cron to push a signal (ie.
> touch a file) at the regular interval, whereupon incron launches the
> existing script, and the webscript can touch the signal file when I need
> the script run right away. Will incron not run the script again if it's
> already running? Will it queue the file event until the handler exits?

You really need to make the script do its own locking so it doesn't matter if
cron runs it or a dozen web users click the 'run now' buttons at once.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-12-2011, 03:11 PM
Brian Mathis
 
Default Triggering script from cron or web client

On Mon, Jul 11, 2011 at 10:16 PM, Kenneth Porter <shiva@sewingwitch.com> wrote:
> --On Friday, July 08, 2011 8:23 PM -0400 Brian Mathis
> <brian.mathis+centos@betteradmin.com> wrote:
>
>> If you don't want to wait a full minute you could use
>> 'incron' to monitor the temp directory and kick the update right away.
>> *Seems better than having something in a loop constantly checking.
>
> incron sounds promising. I could use the regular cron to push a signal (ie.
> touch a file) at the regular interval, whereupon incron launches the
> existing script, and the webscript can touch the signal file when I need
> the script run right away. Will incron not run the script again if it's
> already running? Will it queue the file event until the handler exits?


No, incron will not queue events or wait for the other one to finish.
Your script should take care of this.

One thing to watch out for is if the script is running and you use a
lockfile to exit from a 2nd one running, the original script won't get
the message about the 2nd file. Maybe that matters for this
application, maybe not.


-☙ Brian Mathis ❧-
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 04:33 PM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org