Automap: Moving Jobs folder
Moving the Automap Jobs folder can be troublesome because the Automap GUI
- creates Windows tasks for each job and the tasks point to the original location of the job files, and
- uses relative path names to locate files when it creates a job.
To move the Automap Jobs folder to a new location:
- Use Windows to move the folder to the new location. For example, from C:\Automap\Jobs to C:\srccontrol\Automap\Jobs.
Open the Automap GUI and choose Edit -> Preferences. Change the location of the Job folder to the new location.
- Close the Automap GUI.
- Open the Windows task scheduler and delete all tasks whose name begins with "waj ". If you are not familiar with the scheduler, do an Internet search on "windows task scheduler". You can run the Task Scheduler from the Administrative Tools control panel.
IMPORTANT: If the new directory is on the same disk (such as C:), AND if is the same depth as the original Jobs directory (such as 2 deep in \Automap\Jobs), you can now run the jobs. The Automap GUI will prompt for the account password when creating the new Windows tasks for the job.
Otherwise, the drive is different and or the path depth is different, edit each .waj job and correct the paths. When Automap creates a .waj, it uses relative paths, so each path name tends to begin with something like "..\..\..\directory\filename.ext". At a minimum, the location of the stationary and source document will have to be updated.
<Project path="..\..\..\templates\webworks\Reverb_stationary\Reverb_stationary.wxsp" /> ... <Document path="..\..\..\workspace\doc_main_branch\internal\webworks\automap.book" />
There are various ways to edit the jobs:
- In the Automap GUI, open and edit each job.
- Use a text editor to open and edit each .waj file.
- Use a sed utility to go through each .waj and update the paths.
I like the sed method. I used this batch file to identify each .waj and the run it through Gnu sed (free download).
rem Update all Automap jobs using the script. FOR /D %%p In ("C:\srccontrol\Automap\Jobs\*.") DO c:\Utilities\GnuWin32\bin\sed.exe --in-place=* -f C:\srccontrol\Automap\updateAutomapJob.txt "%%p\%%~np.waj" rem Delete sed temp files that get left around. del /q C:\srccontrol\Automap\sed*.
And the updateAutomapJob.txt file has this substitution:
#updateAutomapJob.tx # Update Automap job paths to replace all "..\..\.." with "c:\directory". s/..\\..\\../c:\\directory\\/
IMPORTANT: The <project path=""> must be either relative (e.g., "..\..\..", or include the drive letter (e.g., "c:\directory\..."). Otherwise the Automap GUI Target Configuration tab is greyed out and unavailable.