windows hobocopy ignorepattern choose folderA OR folderB - regex use | in command line
I am trying to use hobocopy to do a copy from X to Y. I do not want a couple of the folders to come across so I thought the /ignorepattern param would be fine to use. It works fine like so:
HoboCopy.exe /full /statefile=C:\scripts\test.dat /y /r C:\GIT\Apache \\192.168.0.2\backups\websites\testcopy /ignorepattern=repositories
In this case it will not copy the "repositories" folder. But if I want to ignore two or more folders I need to use a regex (as I understand it) to skip them:
HoboCopy.exe /full /statefile=C:\scripts\test.dat /y /r C:\GIT\Apache \\192.168.0.2\backups\websites\testcopy /ignorepattern=repositories|temp-repo
The problem is it thinks the "|" is not part of the regex and I get the following error:
'temp-repo' is not recognized as an internal or external command, operable program or batch file.
If I quote the regex pattern 开发者_运维问答then it just copies all the folders across.
I am using hobocopy because it is good for shadow copies and I do not want various copying programs on the machine if I can just use the one across all tasks.
Thanks
The shell escape character in Windows is ^. So you could try something like this:
HoboCopy.exe /ignorepattern=repositories^|temp-repo /full /statefile=C:\scripts\test.dat /y /r C:\GIT\Apache \\192.168.0.2\backups\websites\testcopy
精彩评论