7 FTP_NEW, Utilities, Tracks an FTP Site for File Changes   I FTP_NEW is a command procedure to check an ftp directory or tree for new,  changed, or removed files.  H The procedure gets a listing of the directory using DIR/FTP/FULL, parsesJ the output, and stores the file information in an indexed file. The latestH file information is compared to that stored to identify new, changed, orM removed files. The procedure can optionally call an action routine to process 4 a new or changed file based on a simple text filter.    $ Usage: $ @FTP_NEW CONFIGURATION_FILE  H Parameters are passed using a configuration file. A configuration recordG consists of a key and a value separated by whitespace (spaces or tabs).   ' NODE		ftp_server		FTP server to contact ! [TYPE]		UNIX|VMS		FTP server type 0 [DIR]		directory_name		Directory name to explore* [FILE]		file_name		File name mask to match) [USER]		ftp_username		FTP server username ) [PASS]		ftp_password		FTP server password = [RECURSE]	TRUE|FALSE		Explore sub-directories (default FALSE) 2 [DATES]		TRUE|FALSE		Compare dates (default FALSE)5 [CASE]		TRUE|FALSE		Action filters are case sensitive 4 [LIMIT]		INTEGER			Limit the number of action events/ [ACTION]	filter routine [param]	See notes below   J Configuration using only tabs as separators can be enabled by defining theK logical FTP_NEW_STRICT_CONFIG to "1", this allows for spaces to be included   in values (e.g. directory_name).  I The default configuration file extension is .CFG .The procedure creates a F data file and a history file. The files are created using the name andG location of the configuration file with extensions of .DAT and .HISTORY 
 respectively.   G Directory trees can be processed using the RECURSE option in which case 5 the procedure calls itself to process subdirectories.   C By default the procedure compares only size information to identify  changes.  J The logical FTP_NEW_DEBUG can be defined to increase the level of logging, e.g. $define FTP_NEW_DEBUG 1     Actions  ------- < An action can be called for a new, changed, or removed file.  O The format of an action configuration entry is (tokens separated by whitespace)   !  ACTION		filter		routine		[param]   B  filter  - text appears in filename (e.g. *.txt) or * to match all"  routine - FTP_NEW routine to call'  param   - parameter to pass to routine   I Actions are evaluated in the order they appear in the configuration file, & the first matching action is executed.  H The filter text string is compared with the file name only, i.e. not theH directory portion, and excluding the VMS file version. Partial wildcards: are supported using the * wildcard operator (.e.g. *.txt).   Action routines are:  %  MAIL        - mail the file to PARAM 1  NOTIFY      - mail notification of file to PARAM (  NULL        - mark the file as actionedG  COPY        - copy file to directory PARAM using default transfer mode A  COPY_ASCII  - copy file to directory PARAM using text/ascii mode =  COPY_BINARY - copy file to directory PARAM using binary mode H  DCL         - call DCL command procedure PARAM, the procedure is calledL                with P1 remote node, P2 remote directory, P3 remote filename,L                P4 reflects the state change - "NEW", "CHANGED", or "REMOVED"F  DCL_ASCII   - call DCL command procedure PARAM after copying the fileJ                in text/ascii mode to a temporary file. Parameters P1 to P4@                are as DCL, P5 is the name of the temporary file.:  DCL_BINARY  - like DCL_ASCII but with a binary mode copy.  I The datafile records the last successful date an action was processed for H each file, and will retry failed actions on subsequent runs if required.H DCL action procedures should return a meaningful status value, an actionA is treated as failed if it returns a severity other than SUCCESS.   I Files identified as new, changed, or removed are actioned if they match a J filter. On the first run all files are treated as new and WILL be actionedG if they match a filter. If you add a new filter that matches a group of J files that have never been actioned they WILL be actioned. The NULL actionH routine can be used to mark a group of files as actioned prior to adding
 a new filter.      Example configuration file:   ( ! OpenVMS Alpha 7.3-2 Patch Notification !  !  node		ftp.itrc.hp.com # dir		/openvms_patches/alpha/V7.3-2/  recurse		false/ dates		false			! inconsistent dates within site  ! F ! Uncomment this for the first run if you do NOT want to be mailed all ! existing .txt files  ! - !action		*	null		! mark all files as actioned  ! 4 action		.*	null		! ignore all files with a leading .: action		*.txt	mail	bloggs	! mail .txt files to user BLOGGS      ( Graham Burley <burley@encompasserve.org>