jueves, 16 de junio de 2011

RestoreNewest.cmd - Simple scripts for Backup in Windows using MSDOS

Similar to the functionality of ListBackup, but in this case we only restore the newest file.

Basically, it takes all backup sets, order the sets by date in a descendant manner, and then extract the required files from all available backups without overwriting. As we first process the newest backup set, we assure that the newest file is restored.

Most of the script is similar to ListBackup.cmd bun in this case we restore the contents mnot only list it.

For the restore, we ser a new variable:

set restoreDir=%restoreDrive%Restore_.%backupExt%

In this case the command is:

if "!process!"=="1" (
"%rarPath%\rar.exe" x -o- "%backupDir%\%%i\%%x" "%processfile%" %restoreDir%\ >> %restoreDir%\Restore.log
)

The new switch for WinRAR is

o- Do not overwrite existing files

The usage is:
D:\>RestoreNewest.cmd local*

Where local* is the file name we are looking for. The file can contain wildcards.

No hay comentarios: