Home > Commands A-M > Commands B

BACKUP


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Backs up one or more files from one disk to another.


Syntax

BACKUP source destination-drive [/A] [/D[:]mm-dd-yy [/T[:]hh:mm:ss]] [/F | /F[:size]] [/HD] [/L[:[drive][path]logfile]] [/M] [/P] [/S]


Parameters
destination-drive: (v2.0 NT3.5)
Specifies the drive to save backup copies onto.
source (v2.0 NT3.5)
Specifies the file(s), drive, or directory to back up.

Switches
/A (v2.0 NT3.5)
Adds backup files to an existing backup disk.
/D[:]mm-dd-yy (v2.0 NT3.5)
Backs up only files changed on or after the specified date.
/F (v3.30)
Formats destination disk, to "standard capacity", if not formatted.
/F[:size] (v4.0 NT3.5)
Formats destination disk, to "standard capacity", if not formatted. Specifies the size of the disk to be formatted (or any other format variation):
     SIZE          size   sides     density  3.5 / 5.25
     160[K[B]]    160KB, single,     double, 5.25
     180[K[B]]    180KB, single,     double, 5.25
     320[K[B]]    320KB, double,     double, 5.25
     360[K[B]]    360KB, double,     double, 5.25
     720[K[B]]    720KB, double,     double, 3.5

     1200[K[B]]
     1.2[M[B]]    1.2MB, double,  quadruple, 5.25
     1440[K[B]]
     1.44[M[B]]  1.44MB, double,  quadruple, 3.5
     2880[K[B]]
     2.88[M[B]]  2.88MB, double, extra-high, 3.5
     20.8[M[B]]  20.8MB, floptical (mag-op), 3.5
     SIZE          size   sides     density  3.5 / 5.25
/HD (v3.30?)
UNDOCUMENTED When auto-formatting a disk for backup use, causes the disk to always be formatted to high density (1.2 or 1.44 Mb).
/L[:[drive:][path]logfile (v3.30 NT3.5)
Creates a log file and entry to record the backup operation.
/M (v2.0 NT3.5)
Backs up only files that have changed since the last backup. (VIA A attribute).
/P (v5.0)
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 (v2.0 NT3.5)
Backs up contents of subdirectories.
/T[:]hh:mm:ss (v3.30 NT3.5)
Backs up only files changed on or after the specified time.

Related

RESTORE - recover files from backups.


Notes
Files stored in special compact format

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.


Backup creates two files: BACKUP and CONTROL

v3.30 through v5.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.


Do not mix BACKUP Versions

The /A option does not work if the files on the backup disk were copied using a BACKUP program in v3.20 or earlier.


Do not write-protect diskettes

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.


Examples

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.


    BACKUP C:\*.* A: /S

Does a complete backup of all files on the hard disk (drive C:), storing the backed-up files on drive A.


    BACKUP C:\DBASE\*.DBF A:

Backs up all .DBF files from a directory named C:\DBASE.


    BACKUP C:\*.DAT A: /S /M /A

Backs up files in all directories (/S) with an extension of .DAT that have changed since the last time they were backed up (/M). These files are added to a previously-used backup diskette (/A).


    BACKUP C:\*.* D:

Creates a directory named D:\Backup on drive D: and backs up all files on drive C: to that directory.


    BACKUP C:\*.* A: /S /D:01-12-89 /T:17:00:00] /L:C:\12JAN89.BKP

Backs up files on C: created or modified after 5pm Jan 12, 1989. The file C:\12JAN89.BKP will contain a Log of the files saved.


    BACKUP C:\*.* A: /F720 /A

Does a full backup to a 3.5" diskette drive A: and formats diskettes as needed. Low-cost 720K-capacity diskettes may be used.


    BACKUP C:\ A: /S

Backs up all files on your hard disk starting with the root directory to the disk in drive A. The /S switch causes the operating system to back up the subdirectories in each directory. Deletes any files already on the floppy disk.


    BACKUP C:*.DOC A:

Backs up files having the extension .doc from the current directory on drive C to the disk in drive A. Deletes any files already on the floppy disk.


    BACKUP A:\BUDGETS B: /S

Backs up files from the budgets directory and its subdirectories on the disk in drive A to the disk in drive B. The /S switch causes the operating system to back up all subdirectories of the budgets directory. Deletes any files already on the floppy disk.


    BACKUP A: C:

Backs up files from the disk in drive A to drive C. The backup files are placed in a subdirectory called backup, which the operating system creates on drive C under the root directory.


Errorlevels
Availability
External
DOS
v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Windows
Win95 Win98 WinME
Windows NT
NT3.5 NT3.51 NT4 NT2000 NTXP NT2003

Last Updated: 2006/12/01
Direct corrections or suggestions to: Rick Lively