Surface Water Information--Data Scripts
check_junk.pl
This script is not yet supported (and may never be), but is provided in the interim because many users may find it valuable. Questions about this script should be referred to the script author. The status of the script is noted.
Name:
check_junk.pl - Utility to notify interested parties when incoming data does not process successfully in DECODES.
Information:
This simple script checks the DECODES "junk" area (currently /usr/opt/nwis/data/sentry_depot/junk) for new files showing up in that area and alerts interested parties to their presence.
Example alert email contents with default messages (subject line and message can be changed via settings at the top of the script if desired):
-
There was a problem processing file(s) through Decodes.
Check /usr/opt/nwis/data/sentry_depot/junk for the problem file(s)
Installation:
- Download and unzip the file to your NWIS server to the location of your choice
- Make the script executable (chmod +x check_junk.pl)
- Modify the indicated lines near the top of the script to set which email addresses you want the script to send alerts to and the number of "permanent" files and directories you have in your "junk" directory (will at least be 2 to account for "." and "..", but may be more if you maintain other permanent sub-directories or files there - remember to update this if you add or delete 'permanent' files/directories later).
- Set the other options as necessary/desired as explained in the script (the top two are the most important and most likely to need changed...)
- Set up the script to run by cron on the schedule of your choice (type 'man crontab' and 'man cron' for more information on setting up cron processes).
Example crontab entry to run the script at 0500 hrs and 1100 hrs every day of the week:
# Check for new files in the DECODES junk directory and email if any are found.
00 05,11 * * * /home/user/check_junk.pl
Script Language:
ksh
Requirements:
Author(s): (for unsupported scripts, please address questions/comments to the author)
Original author Jon Richards (jrichard@usgs.gov), Washington WSC
Known Problems/Limitations/Need Improvements:
Scripts:
- Version 1.0 (Posted 12/19/11):
- check_junk.pl download (Zip file =
1.2K)
Back to Scripts
[an error occurred while processing this directive]