NerdyHearn
Home
Blog

Contact
Mailing List

Software

Active Directory Products
Object Compare
Permission Compare

IPhone Products
Calls To Calendar
SMS To CSV
SMS To Gmail
Voicemail To Gmail

Sites
DocuTerminal
How Long For Me
My Music To Me
SaveMySerials
TypeCount

Blog
Twitter

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.

Tags

System_Maintenance

Related Blogs

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

Comments

Currently no comments.

Add A Comment

Name:


URL:


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


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. DocuTerminal - Online Filing Cabinet solution. Scan, search and archive your paper documents. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers My Music To Me - Stream your subsonic music collection to your Sonos wireless system TypeCount - Count how often you type across different computers! ServrTrackr - Monitor your SSL certificates, website uptime, and DNS configurations