1
@ECHO OFF

C:\DOS\XSET DAY DAYOFWEEK
IF NOT "%DAY%" == "1" GOTO END

:BACKUP
C:\DOS\XSET CUR-DATE DATE YY-MM-DD
IF EXIST C:\BACKUP\%CUR-DATE%.ZIP GOTO FILE
C:\UTIL\PKZIP\PKZIP C:\BACKUP\%CUR-DATE%.ZIP C:\DATA\*.*

XCOPY C:\Users\Admin\Downloads*.ZIP /DB#7 /RSY /PD0 /ED
GOTO END

:FILE
ECHO.
ECHO    %CUR-DATE%.ZIP File Already Exists!
ECHO      No Additional Backup Performed.
ECHO.

:END
SET DAY=
SET CUR-DATE=

Hi This is my above code I want to create an automatic backup based on day For Example today is Monday if i am running a backup script it should take last Monday backup & also check the date of last monday. Then it should overwrite the data in folder called Monday I will be creating each folder each in a week i.e. for Tuesday folder name Tuesday will be created, for Wednesday a folder name Wednesday will be created

chwarr
  • 6,777
  • 1
  • 30
  • 57
  • It looks like you are using `XXcopy` as `Xcopy` does not have those switches. XXcopy may have switches to create the day of week folder. – foxidrive Nov 26 '13 at 14:08

1 Answers1

0

Why don't you try yarcgui which is a gui for robocopy and will make your task much easyier: http://yarcgui.wilkes.es ?

peet
  • 274
  • 3
  • 5
  • 18