D_back soft logo
19-October-2017

How you can backup open files.

What will happen if you will try to copy a file opened by other application? Sometimes you will get an error message, because access to the file may be locked if it is opened in exclusive mode by other program. But how you can copy or backup locked file anyway?

Since Windows XP system, Microsoft has developed a technology, named as Volume Shadow Copy service (VSS). Due to this technology, applications can access files which are opened or locked by other programs.

VSS makes a consistent shadow copy of a volume at a given point in time. This shadow copy is a read-only copy (snapshot) of the volume that can be used by the backup application during the backup job. There is no need to stop any programs to create a shadow copy. Snapshot creation is a quick procedure, it takes only few seconds. The volume snapshot is not changed even if any files on that drive are modified during backing up, so other applications can continue work with files on the volume, uninterrupted by the backup. After the backup is finished, the shadow copy can be deleted.

For details see the Microsoft tech Center information How Volume Shadow Copy Service Works.

Note:
  • VSS is available only on Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista.
  • To use VSS your system must have at least one NTFS volume.
  • Volume Shadow Copy service is available only for local volumes, not for a network resources.

How D_back uses advantages of VSS

D_back is fully integrated with the Volume Shadow Service. To back up files that are in use or locked, you must open file path properties and check the appropriate checkbox (see the screenshot below):

backup open files checkbox

That's all you need to do. The program will create a snapshot of a path's volume before the backup begins, back up files from that snapshot and delete shadow copy when job will be completed.

Advanced technique - using VSS to make consistent data backups

You can use advantages of VSS to create advanced backup strategies.
Take a look at the config sheet with OS Commands. Here you can setup execution of additional OS commands during data processing.
In the section Before backing up you can specify commands to be executed before backup begins.
Pay attention to the section Before data processing when Volume Snapshot will be created. Commands of that section will be executed after creation of a shadow copy but before backup will begin.

advanced backup via Volume shadow copy Service

You can use this two sections for creating consistent data backups, here is a plan how you can do it:

  1. A command of the first section temporary stops the application, that locked files. That will unlock files files to be backed up. For example that may be a command to shut down DataBase;

  2. D_back creates snapshot of volume with files in consistent state, because they are no longer used by the application;

  3. A command in the second section restarts the application (for example - start up DataBase). D_back continues backing up from the volume snapshot, backup will contains files in consistent state.
As an example see article Using Volume shadow copy service to perform Oracle Database cold backup.
© SVA-software