Thank you for your reply!
No, I don't want to name the backups by date. Long ago, I used to name them
by weekdays, but when the backups grew too large, my backup disk did not
have room enough for 7 backups, so now I don't want more than 3 backups at
one time.
So what I need is mainly a script for renaming the backups the way I
indicated.
"aCkRiTe" <(E-Mail Removed)> skrev i meddelandet
news:88402A8A-6B60-47C7-B441-(E-Mail Removed)...
> Personally I would name the backups by date. It is completely up to you
> though. Here is an example of how to set the current date and time into
> variable if you choose. Let me know if you still want to use your original
> way and I'll see what I can come up with for you...
>
> *****lines that don't begin with 2 space have wrapped accidentally*****
>
> @echo off
> setlocal
> for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set
xdate=%%a-%%b-%%c
> for /f "tokens=5-6 delims=:. " %%a in ('echo/^|time^|find "current"') do
> set xtime=%%a-%%b
> cls
> echo.
> echo Date - %xdate%
> echo.
> echo Time - %xtime%
> echo.
> endlocal
> pause
>
> *****lines that don't begin with 2 space have wrapped accidentally*****
>
> This script just shows you how to get the time and date into a variable. I
'm
> assuming you know a little about shell scripting to figure the rest out.
If
> not let me know and I will try to help you further...
>
>
> "Hans Näslund" wrote:
>
> > I used to have a nice little batch file for my backup, which renamed
> > yesterday's backup from Backup to Backup1, and the backup from the day
> > before yesterday from Backup1 to Backup2, and then started the actual
> > backup.
> >
> > The batch file was created with the help from some of the computer
wizards
> > here, but silly enough I did not have a backup of it, so when I recently
had
> > a disk crash, the batch file got lost.
> >
> > May I ask the knowledgeful people here for some help to re-create such a
> > batch file again?
> >
> > Hans
> >
> >
> >
|