[kwlug-disc] Clock-time limits

L.D. Paniak ldpaniak at fourpisolutions.com
Wed May 6 23:15:02 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nice one Khalid!

I thought that atd might support time-limited execution in addition to
delays and batching.  Some searching has not turned up any info in this
direction.  Does anyone know if/how at(d) might be used to solve Chris'
problem?

Yes, I have been known to use atd on occasion.

Thanks,
Lori

Khalid Baheyeldin wrote:
> 
> 
> On Wed, May 6, 2009 at 7:31 PM, Chris Irwin <chris at chrisirwin.ca
> <mailto:chris at chrisirwin.ca>> wrote:
> 
>     List, is there a way to limit the amount of clock-time a program is
>     allowed to run?
> 
>     I currently use offlineimap via cron to cache my mail locally. It
>     unfortunately seems to have a habit of becoming unresponsive if it
>     happens to be active when I suspend/resume my laptop (probably the
>     network disappearing). This then causes me to not (locally) receive any
>     mail as when spawned by cron again it bails out due to the existing
>     process.
> 
>     I could add 'pkill offlineimap' to the start of my wrapper script, but
>     was hoping for something more elegant.
> 
> 
> #!/bin/sh
> yourprogram -options &
> CMD_PID=$!
> sleep 300
> kill $CMD_PID
> 
> That should limit it to running for 300 seconds only.
> -- 
> Khalid M. Baheyeldin
> 2bits.com <http://2bits.com>, Inc.
> http://2bits.com
> Drupal optimization, development, customization and consulting.
> Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
> Simplicity is the ultimate sophistication. --   Leonardo da Vinci
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> kwlug-disc_kwlug.org mailing list
> kwlug-disc_kwlug.org at kwlug.org
> http://astoria.ccjclearline.com/mailman/listinfo/kwlug-disc_kwlug.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFKAlI28h2PnOHbiQcRAmPHAJ0a8YSV+SyBKEKuy96Z6qY68dv02gCdHFKT
oMbTehKeZVuDgn6vhCDx3nU=
=DuXq
-----END PGP SIGNATURE-----



More information about the kwlug-disc_kwlug.org mailing list