Re: modify incremental_backup

Tech-Archive recommends: Fix windows errors by optimizing your registry



"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?

.



Relevant Pages

  • Re: How to program Enable, Disable drivers?
    ... Use this batch file to enable or disable a device ... setlocal enabledelayedexpansion ... echo Syntax: Device enable / disable ... Open a Command Prompt. ...
    (microsoft.public.windowsxp.general)
  • Re: Files deleted but free space doesnt increase
    ... The strange thing is that when I give you a self-logging batch file to ... echo %date% %time%> c:\test.txt ... command prompt to do that, ... deleting the files? ...
    (microsoft.public.windows.file_system)
  • Re: [SLE] Bat files in Linux
    ... > I have a few commands that I would like to run at the command prompt. ... > In Windows I do this with a bat file that looks like the sample below. ... > ECHO Backup Menu ... > ECHO A. Flash Drive Backup J: ...
    (SuSE)
  • Re: Script to MOVE file and leave a Shortcut to new location
    ... It also avoids re-creating any already existing shortcuts, so you could run it after your subsequent robocopy cleanup runs. ... @echo off ... Since your description about the source and target folders is rather vague, you may have to tweak the above batch file a little in order to suit your environment. ... You must test the batch file from the Command Prompt. ...
    (microsoft.public.windows.server.scripting)
  • Re: Scheduled Tasks Doesnt Wait for Backup to Finish
    ... running the DVD Differential job, but it is not shown running in Scheduled ... get a bad DVD once in a while, but Backup MyPC tells me. ... Run the batch file you see below. ... echo %date% %time%> c:\log.txt ...
    (microsoft.public.windowsxp.general)