|
$GetDataFiles
|
|
| 1) Check for previously failed scripts
|
|
|
| If the file "GetDataFiles.status" is present in the specified local directory (LocalDataDir), $GetDataFiles will stop. The presence of this file indicates that the previous script failed during execution. Because we want to process data in chronological order, no old error can remain when a new script is started.
|
|
|
| To handle errors -
|
| · | go to LocalDataDir
|
| · | look for a file with the filename "Failed YYYY-MM-DD HH.MM.SS.tic.cnu", open it, run it, fix any errors
|
| · | delete the file "Failed YYYY-MM-DD HH.MM.SS.tic.cnu" and the file "GetDataFiles.status"
|
| · | rerun the file where $GetDataFiles stopped
|
|
|
| 2) Get files from remote FTP or POP3 server (If Method=Dir, this step is ignored)
|
|
|
| Two types of files are accepted - clear text files with the .txt extension or, if the Decrypt parameter is specified, PGP encrypted files with the .asc extension. All other files are deleted (POP3) or ignored (FTP).
|
|
|
| If Method=POP3, all mail from the specified mail server account is collected. The body part of the message is ignored. .asc or .txt attachments are stored in LocalDataDir.
|
|
|
| If Method=FTP, all .asc or .txt files from the RemoteDataDir of the specified server are downloaded and stored in LocalDataDir.
|
|
|
| 3) Expect files
|
|
|
| If "EveryRun" is specified in the ExpectFile parameter, $GetDataFiles will return an error if -
|
| · | Method=Dir - no valid data file exists in LocalDataDir.
|
| · | Method=POP3 or FTP - no valid data file are downloaded from the remote server.
|
|
|
| 4) Decrypt files
|
|
|
| If the decrypt parameter is specified, encrypted files are decrypted.
|
|
|
| 5) Build list of files in [DataFiles] section
|
|
|
| SetupBatcher replaces the $GetDataFiles command in the [DataFiles] section with a list of files built from LocalDataDir.
|
| The oldest file will be listed first, this is to make sure that files are processed in chronological order.
|
|
|
| 6) Import and execute files in [DataFiles] section
|
|
|
| The [DataFiles] section is executed, all listed files are imported into the [Data] section, one by one, and the [Init] batch section and the [Batch] section are executed for each file.
|
| Valid options: Dir | POP3 | FTP
|
| · | Dir - build a list of files from LocalDataDir, decrypt and execute them - useful to debug scripts or if data is copied through windows shares.
|
| · | POP3 - connect to a POP3 mail server, receive attachments.
|
| · | FTP - connect to a FTP server, download files. Currently supported directory listing styles are UNIX and MS-DOS.
|
| GetDataFiles working directory. Only files with .txt and .asc extension are accepted (depending on Decrypt parameter). Remember to include a command in the script that moves or erases finished files from the LocalDataDir directory or else the same file may be processed several times.
|
| · | Dir: not used.
|
| · | POP3: IP name of POP3 mail server - example: "pop.mymail.com".
|
| · | FTP: IP name or address of FTP server - example: "ftp.myftp.com". Specify port number by adding a colon - example: "ftp.myftp.com:7832".
|
| · | Dir: not used.
|
| · | POP3: mail server user name, usually the part before the "@" sign in the email address.
|
| · | FTP: FTP user name.
|
| · | Dir: not used.
|
| · | POP3: mail server password.
|
| · | FTP: FTP password.
|
| · | Dir: not used.
|
| · | POP3: not used.
|
| · | FTP: remote directory.
|
| · | Dir: not used.
|
| · | POP3: specify "Delete" to delete messages when read from the mail server.
|
| · | FTP: specify "Delete" to delete files when read from the FTP server. (On the FTP server, please make sure to assign write / delete permissions to the FTP account used.)
|
| Use this switch as a protection against lost files / errors at the server end.
|
| Options: EveryRun |
|
| · | EveryRun - At least one data file is expected every time $GetDataFiles is executed, if there is no file, an error is returned. (Create an empty file at the server end when there is no data available.) Use the [OnError] section to write to the event log or to alert the administrator. Remember to delete finished files in the end of the script, see example below.
|
| · | Nothing - blank parameter - do not expect a file
|
| Options: Log |
|
| · | Log -
|
| · | Dir: not used.
|
| · | POP3: specify "Log" to create a log file of received message headers / attachments in LocalDataDir. Filename: GetDataFiles_YYYY-MM-DD.log.
|
| · | FTP: specify "Log" to create a log file of received files in LocalDataDir. Filename: GetDataFiles_YYYY-MM-DD.log.
|
| · | Nothing - blank parameter - do not log anything
|
| Options: GnuPG |
|
| · | GnuPG - SetupBatcher searches for an installed copy of GnuPG and uses it to decrypt PGP files. Notice: encrypted files must have the extension .asc. Encryption is a must when files containing user names and passwords are sent over a network. For more information about GnuPG, see the below full example.
|
| · | Nothing - blank parameter - clear text file, do not decrypt
|
| Passphrase for secret GnuPG encryption key, leave blank if no passphrase.
|