The BACKUP9.EXE utility will maintain a number of
backups (9 by default) of a file.
For example, this command:
backup9.exe c:\baz\foo.bar
Will generate these backup files:
c:\baz\foo.bar.bk1
c:\baz\foo.bar.bk2
c:\baz\foo.bar.bk3
c:\baz\foo.bar.bk4
c:\baz\foo.bar.bk5
c:\baz\foo.bar.bk6
c:\baz\foo.bar.bk7
c:\baz\foo.bar.bk8
c:\baz\foo.bar.bk9
Where foo.bar.bk1 is the most recent backup, foo.bar.bk2 is the next most recent backup, et cetra.
Please note that this assumes that backup9 was called 9 times, and the original file
changed each time.
Usage
backup9 [/a] [/e] [/i] [/l#] [/m] [/nologo] [/q] [/s] [/v] filespec [target]
Where
filespec is a specification of the file(s)
that should be backed up, and
target is the directory
where the backup files should be created.
Switches:
/a | Always perform backup, even if no change since last backup. |
/e | Replace the source file's extension instead of appending. |
/i | Ignore errors in the file specification. |
/l | Number of backup levels, from 1 to 999 (defaults to 9). |
/m | Maintain the directory structure. This is only applicable with the /s switch and a target directory. |
/nologo | Suppress logo banner. |
/q | Quiet mode - no banner or operation status. |
/s | Recursively enter subdirectories. |
/v | Verbose mode. |
Notes
- The filespec can contain the wildcard characters, the asterisk (*) and
the question mark (?). It can also include multiple files separated by semi-colons.
- If the target directory does not already exist, it will be created.
If no target directory is specified, the backup files are created in the same directory as
the source file.
- If either the filespec or target parameter contains
spaces, it should be enclosed in quotes.
- No backup is made if the file has not changed since the last backup.
- If a file is locked, backup9 will retry up to 10 times over a one second period.
This is helpful for files that are sometimes briefly locked, like a database.
- Pressing the Escape key will interrupt the operation.
Example #1: Specifying a Target Directory
backup9 /l3 c:\baz\foo.bar d:\target
Produces these backups:
d:\target\foo.bar.bk1
d:\target\foo.bar.bk2
d:\target\foo.bar.bk3
Example #2: Wildcard, Long Path
backup9 /l3 "c:\baz\foo bar.*"
Might produce these backups:
c:\baz\foo bar.dat.bk1
c:\baz\foo bar.dat.bk2
c:\baz\foo bar.dat.bk3
c:\baz\foo bar.txt.bk1
c:\baz\foo bar.txt.bk2
c:\baz\foo bar.txt.bk3
Example #3: Multiple Files
backup9 /l3 c:\baz\foo.dat;bar.txt
Produces these backups:
c:\baz\foo.dat.bk1
c:\baz\foo.dat.bk2
c:\baz\foo.dat.bk3
c:\baz\bar.txt.bk1
c:\baz\bar.txt.bk2
c:\baz\bar.txt.bk3
Example #4: Replacing Extensions
backup9 /l3 /e c:\baz\foo.bar
Produces these backups:
c:\baz\foo.bk1
c:\baz\foo.bk2
c:\baz\foo.bk3
Download
Click here to download version 2.2 of BACKUP9.EXE (released 27-Aug-2010).