Re: modify incremental_backup
- From: Joe King <br25354@xxxxxxxxx>
- Date: 16 Feb 2009 23:57:38 GMT
"Pegasus \(MVP\)" <I.can@xxxxxxxxxx> wrote in
news:e8cYE$IkJHA.5812@xxxxxxxxxxxxxxxxxxxx:
Try the following batch file:
01. @echo off
02. set Source=d:\My Data
03. set BackupFolder=e:\My Backups
04.
05. for %%a in (%date%) do set MyDate=%%a
06. set Dest=%BackupFolder%\%MyDate:/=-%
07. if not exist "%BackupFolder%" md "%BackupFolder%"
08. set MyDate=%date:/=%
09. for /F "skip=4 delims=" %%a in ('dir /b /ad /o-d "%Folder%"') do (
10. echo rd /s /q "%BackupFolder%\%%a")
11. echo robocopy "%Source%" "%Dest%" *.*
Instructions:
- Copy & paste the file into c:\MyBackup.bat. Do NOT retype it.
- Adjust lines 02 and 03 to suit your environment.
- Adjust line 11 by adding the appropriate switches for robocopy.
- Remove the line numbers.
- Open a Command Prompt.
- Run the file from the Command Prompt as it is and check if it
would do what you expect.
- Remove the word "echo" in line 11 to activate the backup feature.
- Run the file for 5 or six weeks.
- Run the file from the Command Prompt and check if it would
remove the appropriate backup folders.
- Remove the word "echo" in line 10 to activate the folder deletion
feature. And for fun: Compare the size of the above batch file with
the size of your original VB Script file.
line 4 is intentionally blank?
.
- References:
- modify incremental_backup
- From: Joe King
- Re: modify incremental_backup
- From: Pegasus \(MVP\)
- Re: modify incremental_backup
- From: Joe King
- Re: modify incremental_backup
- From: Pegasus \(MVP\)
- modify incremental_backup
- Prev by Date: Re: modify incremental_backup
- Next by Date: Re: modify incremental_backup
- Previous by thread: Re: modify incremental_backup
- Next by thread: Re: modify incremental_backup
- Index(es):
Relevant Pages
|