Okay, I know about 'cron' and 'at', but how do you schedule jobs (scripts) based on events. For instance: Run script xyz when file abcd.efg arrives via ftp? TIA, Frank M. Ramaekers Jr. Systems Programmer; MCP, MCP+I, MCSE & RHCE American Income Life Insurance Company Phone: (254) 761-6649 Fax: (254) 741-5777
You could schedule (cron) a script that checks for abcd.efg and if it is there, do something. Andrew Cotter Manager of Information Systems Somerset Capital Group, Ltd. P: 203.336.7827 Andrew.Cotter at SomersetCapital.com www.SomersetCapital.com -----Original Message----- From: "Frank M. Ramaekers" <FRamaekers at ailife.com> Date: Fri, 16 Feb 2007 09:03:04 To:"CentOS mailing list" <centos at centos.org> Subject: [CentOS] Event scheduling Okay, I know about 'cron' and 'at', but how do you schedule jobs (scripts) based on events. For instance: Run script xyz when file abcd.efg arrives via ftp? TIA, Frank M. Ramaekers Jr. Systems Programmer; MCP, MCP+I, MCSE & RHCE American Income Life Insurance Company Phone: (254) 761-6649 Fax: (254) 741-5777 _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos
On Fri, 16 Feb 2007, Frank M. Ramaekers wrote:> Okay, I know about 'cron' and 'at', but how do you schedule jobs > (scripts) based on events. > > For instance: Run script xyz when file abcd.efg arrives via ftp?Emit an event into a queue, and periodically wake up and harvest the queue -- ls and diff can detect newly present files so can find procmail can trivially detect and fire off email related enqueuing events -- Russ Herrold
Frank M. Ramaekers wrote:> Okay, I know about 'cron' and 'at', but how do you schedule jobs > (scripts) based on events. > > For instance: Run script xyz when file abcd.efg arrives via ftp? > > TIA, > > Frank M. Ramaekers Jr. > Systems Programmer; MCP, MCP+I, MCSE & RHCE > American Income Life Insurance Company > Phone: (254) 761-6649 Fax: (254) 741-5777 > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centosHi Frank, We handle this scenario by having a cron job running a script periodically (every few minutes). This script first checks whether the file is present before trying to process it. Where multiple files are transferred, we send an empty "marker" file at the end of the transmission cycle. The above script then checks for the presence of this marker, processes the transferred files if it is present and deletes it at the end of the processing cycle. We transfer several thousand files between servers per day using this technique - with very few problems. Contact me off-list if you require assistance in setting this up. Chris Geldenhuis