Scripts Thread, create a folder with dates, in Coding and Web Development; hello,
what i need is help with making a batch file that automaticly back up my work i know how ...
3rd April 2008, 08:11 AM #1 create a folder with dates, hello,
what i need is help with making a batch file that automaticly back up my work i know how to do this and how to make the folder the backed up work will go in to, BUT the bit i am having trouble with is i need a script that will rename or make a folder with the current date.
any will will be appreciated.
thank you
IDG Tech News
3rd April 2008, 08:24 AM #2 Rep Power 12
cd E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\
SET _day=%date:~0,2%
SET _month=%date:~3,2%
SET _year=%date:~6,6%
SET date=%_day%%_month%%_year%
copy wbls m:\eclipsebackups\wbls-%date%
i wrote that to get around the fact that date /t contains /'s which are invalid in folder names (yeah, way to go M$)
hope that works for you
3rd April 2008, 09:04 AM #3 My manual backup of SIMS goes something like this:
REM *** Backs up the SIMS Databases ***
DBATTACH /DATABASE=sims /backup /auto /user=******** /password=************** /SERVER=sims\sims_db
REM *** Copies the Docstorage Folder ***
REM *** Setdate creates a folder structure with the current date as the folder name
setdate.exe yyyymmdd
call setinto.bat date
xcopy d:\sims\sims\docstorage\*.* "D:\Sims\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\Docstorage\%date%\" /e /y
xcopy d:\sims\sims\fmssql\db\sims.db "D:\Sims\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\FMS\DB\%date%\" /y
xcopy d:\sims\sims\fmssql\db\sims.log "D:\Sims\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\FMS\DB\%date%\" /y
xcopy d:\sims\sims\fmssql\db2\sims.db "D:\Sims\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\FMS\DB2\%date%\" /y
xcopy d:\sims\sims\fmssql\db2\sims.log "D:\Sims\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\FMS\DB2\%date%\" /y
del setinto.bat
... and uses setdate .exe to set the variables.
Can't remember where I got setdate from now so I can't credit it.
Hope this helps
HBJB Attached Files
Thanks to Heebeejeebee from:
sharkster (3rd April 2008)
SHARE:
Similar Threads
By cjohnsonuk in forum MIS Systems
Replies: 0
Last Post: 19th March 2008, 12:25 PM
By goodhead in forum Windows Vista
Replies: 5
Last Post: 7th March 2007, 04:42 PM
By OutToLunch in forum Windows
Replies: 5
Last Post: 10th January 2007, 02:55 PM
By CyberNerd in forum BSF
Replies: 29
Last Post: 1st December 2006, 09:43 AM
Thread Information Users Browsing this Thread There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads You may not post replies You may not post attachments You may not edit your posts Forum Rules