| Login

Search this Blog


Links I like to keep around


Here are the most recent postings to this blog. Use the archive calendar or search to find other entries.
Sep4

Written by:R Teachout
9/4/2007 11:43 AM 

ex: ./SiteCode to ./Backup-YYYY-MM-DD-WKD

@echo off

:: Get Current Directory
SET UtilPath=%~dp0
:: Directory in current path to backup
SET DIR=SiteCode

:: ReSet Date Variable to be YYYY-MM-DD-WKD from WKD-MM-DD-YYYY
set DATE=%DATE:/=-%
set DATE=%DATE: =-%
for /f "tokens=1,2,3,4 delims=-" %%a in ("%DATE%") do set wday=%%a&set month=%%b&set day=%%c&set year=%%d
set DATEVAR=%year%-%month%-%day%-%wday%

:: Make Sure destination folder exists..
mkdir "%UtilPath%Backup-%DATEVAR%"
:: Actual Backup Code using robocopy
robocopy /e /s "%UtilPath%%DIR%" "%UtilPath%Backup-%DATEVAR%"

echo DONE
pause

Tags:

1 comment(s) so far...

Rencontre Quimper

Dating has never been easier !
# Rencontre Quimper

By TrackBack on  7/10/2010 12:29 AM

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment  Cancel 

Instead of plug and play - in the Microsoft world you plug it in and play around with it for a few weeks..."
-Sun Microsystems President Scott McNealy

Inspired by Nina