Hello monks,
I have a bunch of polished Perl scripts and Win32 batch files I use for regular sysadmin tasks. I launch these manually from a command prompt, and they handle things like simple backups, file locating, log printouts. These scripts require no user intervention whatsoever, although some take a few parameters. They generally log output to a file, or e-mail me results.
I'd like to write a launcher for these scripts. What I have in mind is a script that loops eternally on my workstation, waiting for trigger from me or someone else. The trigger might be the appearance of a certain file, or maybe a signal from another process. When a trigger is pulled, the launcher will run the appropriate script, and immediately continue waiting for new triggers.
Conceptually, I'm stuck on the best way to actually launch the scripts. I've looked at
fork,
open,
system,
exec, backticks, and a few modules, but they either don't do quite what I need, or they are far too complex for my purposes. I just need to launch a script (or batch or exe) and continue. I don't need to capture output; I don't want to wait for the script to finish execution; I don't care about the success or failure of the process; I don't need any communication with the process after it launches.
What's a simple way of accomplishing this? Thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.