Database Copy

This function produces an exact copy of the database, comprising all the files it consists of. 
You just enter a path name and the program does all the work. 
There are two types of copy (you will be asked which type you want)
 
•	`Plain Copy:` The resulting copy is a self-contained database which can subsequently be used just like the original! (Besides the data files themselves, this include a few parameter files.) You may, for example, give the copy to anybody who may want to use it. 
•	`Backup Copy:` This can be used for recovery in the case of disruption. For security reasons, a backup should be located on another physical disk! If, for example, the database is situated on your PC, you might choose a directory on a file server, and vice versa. Then, recovery is still possible even in the extrem case of physical loss of your computer due to fire or whatever. 

While the copying proceeds, the database will be locked for write access (not read access) to make sure the copy will be consistent. (Important in multi-user environments.) 

For "Backup Copies", the system will save the path name in the INI variable  DbBack . Should a restore action ever become necessary, the system will have that long forgotten name at hand.

But what if a99 will not start any more, i.e. the database can no longer be opened? Then, the ORG menu can neither be called up to initiate the restore! Is everything lost then? By no means. The backup copy will still be where it had been produced (if nothing happened on that disk, that is...),and if the LOG file has also been preserved, the state immediately before the crash can still be recreated. The Backup routine creates a DOS BAT file for that purpose. It will be written to the data path, i.e. it will reside on the database's directory. If you start it, the DOS programs will do all the work and a99 can open the database after that.The name of the batchfile is  xyzREST.BAT, with "xyz" the name of your database. Thus, you enter:  xyzrest directly on the data path, in a DOS window.

If you are curious
In the "Backup Copy" mode, the LOG file will be deleted. This is important because all subsequent action must be recorded in a new LOG file which will then contain everything that was added or edited after the backup copy was made. 
There are other ways to organize security against disruption. The `Handbook`, Chap. 0.7., has more to say about it. The method as realized here is the fastest and most convenient. The only requirement is access to a sufficient amount of disk space elsewhere in the LAN. 
Attention system managers:
It is common procedure to make tape copies of complete disks during night time. 
If the  LOG file is included in such backups, then make sure that the old LOG file will not overwrite the current one! Only the LOG file that exists at the moment of a crash will contain the most recent changes and thus be able to fully restore that database to the state before the crash. A tape copy of the previous day is obviuosly out-of-date. 

?Handbook=h ac0-7 
?Plain Copy:=x var 'N'\ins #uTX\exec X _backup 
?Backup Copy:=x var 'Y'\ins #uTX\exec X _backup