BACKUP AUTOMATICALLY WHEN YOU QUIT LogStar GC
Batch files contain simple commands. You can make batch files yourself, and choose what commands to put in them.
FOR LOG KEEPING
When the Log keeping program, GCL.EXE, is quit, it checks to see if a batch file called GCLOG.BAT exists in the same folder, and if new flights have been logged, it runs the batch file. If the commands in the batch file copy files to a safe place, then a backup is automatically achieved.
FOR TREASURER & MEMBERSHIP
When GCT.EXE or GCM.EXE is quit, if a batch file called GCTRE.BAT or GCMEM.BAT respectively is found in the same folder, it will give the option to run the batch file before you quit. Again this can be used to perform a backup of data. For example if you run the program of a USB memory stick, you could arrange to copy the files to the host computer’s hard drive as a backup. The files to copy are all the files with a .DBF extension for the Treasurer and Membership programs.
The Statistics program does not have the facility to run a batch file.
These versions of LogStar programs are needed for batchfiles to work as above: GCL v083 GCT v071 GCM v059
AN EXAMPLE of a batch program, is given below, which could be used to backup the Log keeping system to a folder in the C: drive called LOGBACK which it makes for you. Note the use of REM at the beginning of a line which tells the computer to ignore that line, as it is only a remark. Also PAUSE which helps you see any error messages after a command. The PAUSEs can be deleted or replaced with REM PAUSE when you are happy with the program.
There are really only two key items in this program:
- MD C:LOGBACK which Makes a Directory (More commonly known as a Folder in Windows) in the C: drive called LOGBACK.
- COPY command, which is worth giving a few examples of:
- COPY *.* C:LOGBACK will copy everthing (* is a word wild card, used here for both the filename and the extension) to C:LOGBACK
- COPY *.DBF C:LOGBACK will copy all the files with a .DBF extension to the same place.
- COPY *.M?? C:LOGBACK will copy all files regardless of name, but the first letter of the extension must be ‘M’ The other two letters don’t care. The ? used here is a letter wild card, as opposed to the * which represents a word wild card.
- Note in the above commands there are two spaces only. One after the word COPY, and one before the destination (C:LOGBACK)
- Note also that because a source path is not specified, the files to be copied are those found in the same folder as the batch file.
This is the example:
REM This line starts with REM & is only a remark. It is here to explain
REM how this program works. The ECHO OFF stops you seeing this on the screen
REM when the program runs. The next line clears the screen.
REM The next line displays the following text on the screen.
ECHO Starting to run BATCH FILE named GCLOG.BAT
REM The next line PAUSEs the program, pending a keystroke.
ECHO ABOUT TO MAKE A FOLDER (DIRECTORY): C:LOGBACK
REM If the folder already exists as it will after the first run
REM an error may be reported. This will not matter.
ECHO Copying files…………..
REM The command COPY *.DBF C:/LOGBACK will copy all the files with a .DBF
REM extension, from the folder where this batch file resides, to C:/LOGBACK
REM It cannot do this if C:LOGBACK does not already exist.
REM Copy the database files. REQUIRED FOR ALL THE PROGRAMS
COPY *.DBF C:LOGBACK
REM Copy any memo files. REQUIRED FOR ALL THE PROGRAMS
COPY *.M?? C:LOGBACK
REM Copy the rest. Following for Logkeeping program only, even if
REM you may not have some of them existing now.
COPY *.PWD C:LOGBACK
COPY *.TWO C:LOGBACK
COPY *.LOG C:LOGBACK
COPY *.DLK C:LOGBACK
COPY *.DAT C:LOGBACK
COPY *.CFM C:LOGBACK
COPY *.CFI C:LOGBACK
COPY *.ARC C:LOGBACK
ECHO End of batch file. All done.
HOW TO CREATE YOUR OWN BATCH FILE:
Use WINDOWS NotePad. To do this right click on a blank area of your desktop, and select New then Text Document. This will place a blank document on your desktop called New Text Document.txt Double click on it to open it, and then type in the code above. (Or better still copy and paste it). When that is done, click on File and Save As. Then type in the filename GCLOG.BAT instead of New Test Document.txt Click Save, and then click File again and then select Exit.
You will now have a batch file on the desktop (An Icon with a yellow gear wheel!) If you double click on it it will run, but will not be able to find the files (in the desktop) to do the copy, so will give messages to that effect. No harm will be done. If you want to modify the batch file, right click on the icon, and select Edit. This will open it up in NotePad again. To run as designed it must then be copied into the folder where the relevant LogStar Program is. Subsequent edits can be made from there.