Mailing List



NerdyHearn - Blog

<< Back To All Blogs

Daily Backup Script

Tuesday, October 21st, 2008

In the world of software development, and specifically in software support, we are often presented with situations in which we need to roll back to previous versions, whether it be for clients or for testing purposes. With the advantage of SVN and CVS we can roll back to states in source code, but to save time and often prevent a build-conflict nightmare it helps to have around setup executables and previous files that change on a regular basis.

I have used the script below as a scheduled daily task for sometime over the past months, and it has saved me countless hours and allowed me to have a quick turnaround with many of our support questions.

The script is a basic windows batch file, and it outputs a daily folder with the daily destinations I choose to back up. Without further ado, here is the script:

for /f "tokens=2-4 delims=/ " %%g in ('date /t') do (
set mm=%%g
set dd=%%h
set yy=%%i

if exist "J:\Backups\Daily\%yy%.%mm%.%dd%" (
rd /S /Q "J:\Backups\Daily\%yy%.%mm%.%dd%"

xcopy "C:\Program Files\Folder" "J:\Backups\Daily\%yy%.%mm%.%dd%" /s /i

That's it, very simple and to the point.

Backin Up Tom Out.



Related Blogs

Changing SVN Server URL Client-side using Relocate
Creating A Solid Backup Plan
Recursively removing SVN bindings with PowerShell
Setting up a real VPN with your every day consumer router and DD-WRT


Currently no comments.

Add A Comment



Email Address: (not public, used to send notifications on further comments)


Enter the text above, except for the 1st and last character:

NerdyHearn - Latest tech news relating to C#, ASP.NET, SharePoint, PHP, general development, and more. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers