Well, if it is unix, you don't have to worry about it if you are running it with cron.
The cron daemon generally runs you script and emails any output to you.
First, you need to tell crond about your script. You'd do something like this in /etc/cron.d/backup (you don't have to call it backup -- that is just the filename I chose):
MAILTO="whereever you want to email any output to"
# the format goes minute hour day month day_of_week
# this will run the backup script as root ever day at
# 4:23 in the morning
23 4 * * * root /path/to/backup/script.pl
Now, in your script, print any errors to STDERR, and die if you have to. This will be mailed to you.
cheers.
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.