Running a process after AutoExport
Return to Introduction  Previous page  Next page
Once the AutoExport has been performed you can optionally run a process for each file that was exported. This is useful if you want to compress the exported files, or if you want to automatically copy them to another location.



The process that is run is fully user configurable through the use of template files. Example templates are provided in the template directory that exists beneath the VOPP3 directory. There are a number of replacement markers that can be used in the templates. At execution time the replacement markers will be replaced by values corresponding to the current autoexport. The replacement markers consist of a percent sign followed by a word. The replacement markers are listed below, with a description following:

Replacement Marker
Description
%FullAEF%
The AEF filename, including path, that is produced by the auto-export.
%AEF%
The AEF filename, excluding path, that is produced by the auto-export.
%FullFile%
The filename, including path, of the processed file. For example, if the batch/cmd file archives the AEF then the %FullFile% name is the name of the archive file.
%File%
The filename of the processed file, excluding path. For example, if the batch/cmd file archives the AEF then the %File% name is the name of the archive file.
%Ext%
The file extension of the processed file.
%Date%
Current date in the format YYYYMMDD.
%Time%
This is the current time as digits. Equivalent to Time24() without the ":". E.g. 223001 is the time 22:30:01
%Hour%
This is the current hour as digits. E.g. 220000 is the time 22:00:00
%Project%
The current project name.
%Drive%
The destination drive the autoexport.
%Path%
The destination path of the autoexport (without drive)
%Primary%
The full destination path for the autoexport.
%Secondary%
The full secondary destination path for the autoexport.
%IsSecondary%
Has a value of TRUE is the secondary path is not blank. This allows to do the following in the batch file:

if %isSecondary%.==. goto NoSecond


NOTE: Lines within a template file that start with // are considered comment lines and are not written to the batch/cmd file.

It is also very important to remember that if your process does change the final file extension then you need to specify it on the configuration screen E.g. if your process moves the autoexported AEF into a RAR file then the final extension should be RAR.

The following template example can be used to compress the exported AEF files using the program RAR.

// Use RAR to compress the exported AEF 
// Don't forget to update the Final Extension 
// field in AutoExport Config!
rar m %file% %aef%

Another more complex example compresses the AEF using ARJ, then copies it to another directory so it does not get overwritten by later exports, and also copies it to a secondary location:

// Use ARJ to compress the exported AEF 
// Don't forget to update the Final Extension 
// field in AutoExport Config!
arj m %file% %aef%

// Create a directory based on the current time.
// This allows the current autoexport file to be copied to
// a subdirectory and prevents it from being overwritten.
md %time%
copy %file% %time%

// If a secondary autoexport directory has been specified,
// copy the file to that location
if not %issecondary%.==. copy %file% %secondary%

Normally you want this processing to occur behind the scenes, but sometimes, especially when first setting up a template, it can be useful to see the process running. To do this you can check the Show process checkbox. Also, if you check the Debug process checkbox then the command file VOPPAUTO.BAT, generated from your template will be left in the export directory so that you can examine it.

AutoExport also looks for additional templates having the same name as your original template but ending in BEFORE and/or AFTER. If it finds these templates it will automatically execute them at the start and end of the AutoExport process. So, if your AutoExport template is named BACKUP.TPL, AutoExport will also look for BACKUP BEFORE.TPL and BACKUP AFTER.TPL. If it finds either of these template files it will execute them - the BEFORE template prior to the export and the AFTER template on completion of the export.



© Piko Computing Consultants, 1998-2002