Robocopy parameter backup

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Krump
Posts: 45
Joined: 02 Dec 2014 14:53

Robocopy parameter backup

#1 Post by Krump » 12 May 2015 23:00

Hi, I have problems with my backup script.

Code: Select all

@echo off
%~d0
cd %~d0%~p0%

md %~dp0C
md %~dp0D
md %~dp0F
md %~dp0G

rem excludes
set ex1= "$RECYCLE.BIN"
set ex2= "Documents and Settings"
set ex3= "MSOCache"
set ex4= "PerfLogs"
set ex5= "Program Files"
set ex6= "Program Files (x86)"
set ex7= "Qoobox"
set ex8= "Recovery"
set ex9= "System Volume Information"
set ex10= "Windows"
set ex11= "All Users"
set ex12= "Default"
set ex13= "Default User"
set ex14= "Public"
set ex15=
set ex16=
set ex17=
set ex18=
set ex19=
set ex20=
set ex22=
set ex23= .sys
set ex24= Thumbs.db
set ex25= *.ini
set ex26= *.tmp
set ex27= *.ost
set ex28= "C:\hiberfil.sys"
set ex29= "C:\pagefile.sys"
set ex30= "C:\winpepge.sys"

set czas=%date:~0,90%   %time:~0,8%
echo Rozpoczeto kopie zapasową %czas% >> %~dp0Info.txt
echo. >> %~dp0Info.txt

set czas=%date:~0,90%   %time:~0,8%
echo %czas% Trwa kopiowanie danych: Dysk C >> %~dp0Info.txt
robocopy.exe C:\ %~dp0C /LOG+:%~dp0LogC.txt /Z /COPY:DT /TIMFIX /R:10 /W:30 /MIR /V /NP /IS /IT /XD %ex1% %ex2% %ex3% %ex4% %ex5% %ex6% %ex7% %ex8% %ex9% %ex10% %ex11% %ex12% %ex13% %ex14% /XF %ex23% %ex24% %ex25% %ex26% %ex27% %ex28% %ex29% %ex30%
attrib -s -h %~dp0C


When I use roboopy parameter /b and it's try copy folder where I have "Access denied" for example "C:\ProgramData\Application Data" script goes crazy. It's start copy from the beginning/but in this directory, so I have in result endless loop directory: Exambple (it's a breking copy) "C:\ProgramData\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Adobe\Setup\{AC76BA86-7AD7-1045-7B44-AB0000000001}\
nazwany 625 ABCPY.INI"

Krump
Posts: 45
Joined: 02 Dec 2014 14:53

Re: Robocopy parameter backup

#2 Post by Krump » 13 May 2015 12:49

And when I use script with admin rights

Krump
Posts: 45
Joined: 02 Dec 2014 14:53

Re: Robocopy parameter backup

#3 Post by Krump » 13 May 2015 13:09

Ok I find it in google it's answer:
http://answers.microsoft.com/en-us/wind ... 57e4d27232

Topic to close

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Robocopy parameter backup

#4 Post by Squashman » 13 May 2015 13:14

That makes sense.

Post Reply