Scheduling GBAK with NT's AT command

Abstract: Scheduling GBAK with NT's AT command

Problem: How to automate GBAK. Solution: Use the AT command, a function of the NT Scheduler Service. Steps: 1) Open: Control Panel / Services Start the Scheduler Service Select Startup button for the Service Select box: Allow Service to Interact with Desktop NOTE: If you change this setting and try to use it during the same session it will not take effect until you stop and restart the service or it will take effect upon reboot if the service is scheduled to start-up automatically. 2) Create: A "batch" file The following is an example of the what the batch file should contain. Absolute paths are necessary. Paths MUST be specific to your machines directory structure. NOTE: The commands in the batch file must all be on one line. (ie. No word wrap.) The "2>" redirects any error produced and creates an error log for you as the DOS shell dies and error are lost upon GBAKs completion. Example: (backup) d:ibbingbak -b -t d:dbsmydb.gdb d:dbsmydb.gbk 2> d:errorserr.txt -user "sysdba" -password "*******" 3) Schedule: You must schedule the job to run with AT from a DOS session. NOTE: There are many scheduling options see the AT help. If you choose select: Allow Service to Interact with Desktop in the Control Panel, you must use the "/interactive" AT option. Start a DOS session d:ibmk> time /* to verify time */ d:ibmk> at (desired time) "d:ibmkntat.bat" NOTE: The AT command may be used to GBAKRESTORE your databases, however, it is recommended to use a unique database name. The same batch file restrictions apply. The recommended syntax would be: d:ibbingbak -c d:dbsmydb.gbk d:dbsunique.gdb 2> d:errorserr.txt -user "sysdba" -password "*******"