BACKUP
Type: External (2.0 and later)
Syntax:
BACKUP [d:][path][filename] [d:][/S][/M][/A][/F:(size] [/P][/D:date] [/T:time] [/L:[d:][path]filename]
Purpose: Makes a backup copy of one or more files. (In DOS Version 6, this program is stored on the DOS supplemental disk.)
Discussion
The first path and filename(s) you enter identify the disk file(s) to be backed up. The second drive specified is the drive where the backup copy will be sent.
If you do not specify the first path, files are backed up from the current directory. If you do not specify a filename or extension, then all files in the directory are backed up.
You can use the wild card characters (* and ?) to specify groups of files to be backed up.
If errors are encountered during the BACKUP process, the ERRORLEVEL exit code is set as follows:
1. No files could be found to back up.
2. Some files were not backed up due to file conflicts.
3. Terminated when you pressed the Ctrl + Break key combination.
4. Terminated due to any other type of error.
These codes can be used with the batch processing IF command to write backup batch files that test for errors during the backup process.
Files backed up using the BACKUP command are stored in a special, compacted format and are therefore not usable for normal file processing. You must use the RESTORE command to recall them and store them in the normal (un-compacted) format.
NOTE:
DOS Versions 3.3 through 5.0 stored backed up files in a different format than earlier versions (the new backup method requires less disk space). In these versions, the BACKUP program creates two files on the backup disk: BACKUP and CONTROL. The BACKUP file will contain all the files that were backed up and the CONTROL file will contain file storage information such as the paths and filenames of the source files.
Options
/A - Does not erase the files on the target disk (DOS normally will erase existing files on the target diskette before it starts backing up the files). Use of this option cancels the prompt to insert a diskette in the target drive before the copying starts, but after the target disk is filled with backed-up files, you will be prompted to insert a new diskette.
NOTE:
The /A option does not work if the files on the backup disk were copied using a BACKUP program in DOS Version of 3.2 or earlier.
/F:(size) Formats the target disk (if it is not already formatted). This option uses the FORMAT program which must, therefore, be accessible via the current path. In DOS Versions 4 and 5, you can use F:(size) if the capacity of the target diskette does not match that of the drive in which you put it. For example, if you are using a 360K diskette in a 1.2M drive, (size) can be 160, 180, 320, 360, 720, 1.2, 1.44, or (in DOS Version 5) 2.88.
/L Makes an entry in the backup log in the file you specify here. If you use this option but do not specify a backup log file, the system creates the file BACKUP.LOG in the root directory of the source drive.
The backup log will contain:
1. The date and time that the files were backed up.
2. The name of the file that was backed up.
3. The number of the backup disk that contains the file.
The information stored in this file can be used when you want to restore a particular file from a backup disk.
If the backup log file you specify already exists, the current entry is added to the existing file.
/M Only backs up files that have been modified since the last time the BACKUP command was used. This switch checks the archive attribute of a file. If the file`s archive attribute is set to off (-A), the file will not be backed up.
NOTE:
If you are backing up files from a diskette, do not write-protect them. BACKUP changes the archive attribute of each file as it is backed up.
/P Packs as many files as possible onto each diskette. This option will create a directory when that is the only way to pack more files onto the diskette.
/S Causes files in the specified directory and all subdirectories below the specified directory to be backed up.
/D:(date) Backs up files only if they have been created or modified on or after the date you enter.
/T:(time) Backs up files only if they have been created or modified on or after the time you enter.
Example
In the following example, all files in the drive C LETTERS directory that begin with SALE and with any filename extension are backed up onto the disk in drive A.
backup c:\letters\sale*.* a:
BACKUP will display a prompt when it is time to insert the disks. If the /A option is not used, there will also be a warning that any files currently stored on the target disk will be erased.
BREAK
Type: Internal (2.0 and later)
Syntax:
BREAK
BREAK on|off
Purpose: Used from the DOS prompt or in a batch file or in the CONFIG.SYS file to set (or display) whether or not DOS checks for a Ctrl + Break key combination.
Discussion
DOS normally detects a press of the Ctrl + Break or Ctrl + C key combination only while checking for keyboard input or while sending characters to the screen.
Some application programs automatically reset BREAK (either ON or OFF); this will cancel the BREAK options you set. For more information on the BREAK command, refer to Chapter 6, Tips for Advanced Users.
Examples
Enter
break on
to tell DOS to check for the Ctrl + C key combination. To determine the current BREAK setting, enter
break
BUFFERS
Type: Internal (2.0 and later)
Syntax:
BUFFERS=(number),(read-ahead number)
Purpose: Used in the CONFIG.SYS file to set the number of disk buffers (a number from 1 to 99) that will be available for use during data input. Also used to set a value for the number of sectors to be read in advance (read-ahead) during data input operations.
Discussion
While conducting input and output operations, DOS stores information in memory buffers so that it will be readily available when requested by an application. The more buffers set in the CONFIG.SYS file with the BUFFERS command, the faster DOS will be able to access the information requested. You should experiment to determine the most efficient number of buffers for your computer and the applications you are running. The same is true for determining the appropriate number of read-ahead buffers. The read ahead buffers determine the amount of data DOS will read from the disk in addition to the data requested by the application. For more information on the BUFFERS command, refer to Chapter 6, Tips for Advanced Users.
Options
number - Sets the number of disk buffers DOS should use (1 to 99). If no value is provided the default value (determined by the amount of memory in your computer) will be used. Generally, if you have 512K of memory, the default will be 15.
read ahead - Sets the number of buffers in the secondary or read-ahead cache. DOS 5.0 allows values of 1 to 8 with 1 as the default. In DOS 6.0 you can specify 0 to 8 with 0 as the default.
Example
To set buffers to 20 and read-ahead buffers to 2 enter the following line in your CONFIG.SYS file
buffers=20,2