# VsBackup

a Windows console backup utility

## Description

vsbackup is a small console backup utility for x64 Windows Vista/7/8.x/10. It utilizes the Windows© Volume Shadow Copy service und can therefore be used to backup open files. There is no special tool necessary to look into the backup and restore your files. And unlike the build in file history thing in Windows vsbackup does not change backup file names and/or append stupid timestamps on it. Just use whatever filemanager you like. It uses NTFS hardlinks to save diskspace while backing up identical files. It is better at excluding files and/or directories then the build-in Windows file history thing

It is, however, not suitable for backing up large and often changin' files such as virtual disk images and it does NOT support UNC path names - i.e. network drives. Backing up network drives can be done by server side software.

You use this program at your own risk. Do not blame me for any data loss.

## Requirements

• a 64bit Windows© Vista, 7, 8.x, 10, Server 2008 or later
• An NTFS-formatted hard drive connected via USB or as internal hard drive
• Microsoft Visual C++ 2015 Redistributable Package

## Usage

Copy vsbackup.exe to a folder on your computer. To backup your data start cmd.exe with administrative privileges. Asume, John Doe would like to create a backup of his home directory to his USB backup drive windows has assigned the letter E: (path and drive letters can be lower or upper case) he will call vsbackup this way:

vsbackup "c:\users\john doe" e:\backup

You can now create a Scheduled Task to backup your files every day or every hour. Thats completely up to you. Just make sure you check the Run with highest privileges checkbox. But don't think you have to create that Scheduled Task, you don't. You can simply run the program and type all it's options over and over again. Or you can of course write a batch file and run that from an elevated command prompt ;) I'd at least recommend the batch file...

## Howto exclude things

1. If you would like to exclude multiple files and/or directories just add one /XF= or /XD= option for each file or directory as commandline option.
2. Do not write the the full path of the file/directory to exclude - i.e. do not write /XD=C:\path\to\exclude instead write /XD=path\to\exclude This is because if the parameter points to an existing file vsbackup will use the content of that file to read the exclusion list from and ignore the command line: /XD=C:\path\to\a\file\containing\directories\to\exclude.txt will read the list of directories to exclude from the given file. The same applies to /XF. That way, both options can easily by combined. Remember to *NOT* write full path names to the exclude files!
3. Having a path containing the same name more then once, like C:\path\with\two\names\in\names\it and you only apply a filter like /XD=names the first hit matches! So the path below the first match will not be saved!

## Handle drive letter changes

Because Windows (©) does change drive letters from time to time, from v0.5 on there is an option /VID= you can set/fill with the volume ID of your backup drive. If you provide this option, vsbackup.exe will scan through all available drive letters and check its volume ID. It will correct your backup path - i.e. the drive letter - if the volume ID was found but did not match the drive letter of your backup destination drive. To obtain the volume ID of your backup drive open up a command box and type vol X: - where X is the drive letter of your backup drive. Now use the value of Volume Serial Number as the parameter value for /VID=XXXX-XXXX

Here's an example screenshot:

## Logging

Log output is written to logfile and to STDOUT and/or STDERR.

## Return codes

• 0 indicates success
• 1 indicates failure

## Limitations

• Until now there is no support for wildcards in file and/or directory names to exclude. This functionality will be part of a later version. For sure!
• Directories created during the backup will have the current timestamp and not the datetime they where created. Allthough there is no problem fixing this I am uncertain whether it will slow down the backup process or not. I will have to read and write those data foreach directory. My experience tells me that those timestamps are not going to be used on restore.
• many more.. - well, not many - some... ;).

## TODO

• implement exclusions based on wildcards for both file and directory names. At least MS-DOS based wildcards
• respect directory creation timestamps
• make it open source software
• fix bugs

## Changelog

The archive contains only a 64bit windows binary

Current archive checksums

• SHA1: e1db9d40aec860363a374d16688428fdf735c353