Type: External (2.0 and later)
BACKUP [d:][path][filename] [d:][/S][/M][/A][/F:(size] [/P][/D:date]
Purpose: Makes a backup copy of one or more files. (In DOS
this program is stored on the DOS supplemental disk.)
The first path and filename(s) you enter identify the disk file(s) to be
up. The second drive specified is the drive where the backup copy will
If you do not specify the first path, files are backed up from the
directory. If you do not specify a filename or extension, then all files
directory are backed up.
You can use the wild card characters (* and ?) to specify groups of files
If errors are encountered during the BACKUP process, the ERRORLEVEL exit
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
batch files that test for errors during the backup process.
Files backed up using the BACKUP command are stored in a special,
format and are therefore not usable for normal file processing. You must
the RESTORE command to recall them and store them in the normal
DOS Versions 3.3 through 5.0 stored backed up files in a different format
earlier versions (the new backup method requires less disk space). In
versions, the BACKUP program creates two files on the backup disk: BACKUP
CONTROL. The BACKUP file will contain all the files that were backed up
CONTROL file will contain file storage information such as the paths and
filenames of the source files.
/A - Does not erase the files on the target disk (DOS normally will
existing files on the target diskette before it starts backing up the
Use of this option cancels the prompt to insert a diskette in the target
before the copying starts, but after the target disk is filled with
files, you will be prompted to insert a new diskette.
The /A option does not work if the files on the backup disk were copied
BACKUP program in DOS Version of 3.2 or earlier.
/F:(size) Formats the target disk (if it is not already
option uses the FORMAT program which must, therefore, be accessible via
current path. In DOS Versions 4 and 5, you can use F:(size) if the
of the target diskette does not match that of the drive in which you put
example, if you are using a 360K diskette in a 1.2M drive, (size) can be
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.
use this option but do not specify a backup log file, the system creates
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
added to the existing file.
/M Only backs up files that have been modified since the last time
BACKUP command was used. This switch checks the archive attribute of a
If the file`s archive attribute is set to off (-A), the file will not be
If you are backing up files from a diskette, do not write-protect them.
changes the archive attribute of each file as it is backed up.
/P Packs as many files as possible onto each diskette. This option
create a directory when that is the only way to pack more files onto the
/S Causes files in the specified directory and all subdirectories
specified directory to be backed up.
/D:(date) Backs up files only if they have been created or modified
after the date you enter.
/T:(time) Backs up files only if they have been created or modified
after the time you enter.
In the following example, all files in the drive C LETTERS directory that
with SALE and with any filename extension are backed up onto the disk in
backup c:\letters\sale*.* a:
BACKUP will display a prompt when it is time to insert the disks. If the
option is not used, there will also be a warning that any files currently
on the target disk will be erased.
Back to the