need help with cmd prompt

[OUPA]MrNutz

Expert Member
Joined
Jan 21, 2005
Messages
1,791
Reaction score
14
Location
Vereeniging
Hi guys.

i've got a weekly backup file of hdd content .tib that is created...say backup.tib

but now when the program runs again with the schedule next week it doesn't create a new file - it overwrites it.

how can i create a batch file that simply does this:

implement date stamps like:

rename backup.tib backup$.tib where $=today's date

then schedule that this bat file is executed just before the actual backup process starts.

2cents?
 
Use something like this:

http://www.windowsitpro.com/Articles/ArticleID/13575/13575.html?Ad=1
@Echo OFF
TITLE DateName
REM DateName.CMD
REM takes a filename as %1 and renames as %1_YYMMDDHHMM
REM
REM -------------------------------------------------------------
IF %1.==. GoTo USAGE
Set CURRDATE=%TEMP%\CURRDATE.TMP
Set CURRTIME=%TEMP%\CURRTIME.TMP

DATE /T > %CURRDATE%
TIME /T > %CURRTIME%

Set PARSEARG="eol=; tokens=1,2,3,4* delims=/, "
For /F %PARSEARG% %%i in (%CURRDATE%) Do SET YYYYMMDD=%%l%%k%%j

Set PARSEARG="eol=; tokens=1,2,3* delims=:, "
For /F %PARSEARG% %%i in (%CURRTIME%) Do Set HHMM=%%i%%j%%k

Echo RENAME %1 %1_%YYYYMMDD%%HHMM%
RENAME %1 %1_%YYYYMMDD%%HHMM%
GoTo END

:USAGE
Echo Usage: DateName filename
Echo Renames filename to filename_YYYYMMDDHHMM
GoTo END

:END
REM
TITLE Command Prompt

-------------------------------------------

Rather run the batch file after the backup otherwise your date/time for the backup will be screwed up.
 
Or look for a setting in Acronis TrueImage to automatically keep x amount of backups.
 
^^

thanx...a bit 2 much for me...

found a much simpler one:

if exist backup_filename.tib rename backup_filename.tib "%date:/=.%.tib"
 
Top
Sign up to the MyBroadband newsletter
X