By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

Access how to create a bulk backup with an "Exception"

anoble1
100+
P: 230
I have a small db that backs up some file folders on a shared drive that contains a lot of data. I am currently using the XCOPY command to do so which works great. However, there are log files all over that take forever to go through, plus I really don't care to capture them. Is there a way to make an exception for xcopy to copy what it normally does, but NOT to copy anything with a (*.log) extension?

I'm doing something like this:

Expand|Select|Wrap|Line Numbers
  1. Shell "xcopy " & """" & "\\Test.com\Test1\Test2\Test3\Test4\Apps" & """" & " " & """" & fileName & "Test4\Apps\" & """" & " /y /i /e /d"
May 15 '14 #1
Share this Question
Share on Google+
3 Replies


zmbd
Expert Mod 5K+
P: 5,397
Here's a link to the XCOPY Syntax

Personally, I would build a script that cleared all of the archive flags from anything with a dot-LOG and the use the "/a" option

however, you can build an exclude text file...
/exclude:filename1[+[filename2]][+[filename3]] : Specifies a list of files containing strings.

>UPDATE>
Pulled my old DOS3.0 book out
A better description would be this:
/Exclude:{path}list_of_exclusions.txt

DO NOT USE SPACES NOR ANYTHING OTHER THAN THE ALPHANUMERIC and UNDERSCORE IN THE PATH AND FILE NAME!
This is OLD SCHOOL 8.3 type naming convention (even if you can use a longer name keep it simple and you'll be happier!).


now at the full path you have crete the text file that has just
.log
.LOG

in the file and save.

Now I remember why my batch files would go thru and set/clear the archive flags for files... easier.
May 15 '14 #2

pod
100+
P: 298
pod
I do not know much about XCOPY but I know that you could Google for some VB code to go through your file system, filtering out any file extension you desire; and from there you could run your XCOPY command through the Shell
May 15 '14 #3

anoble1
100+
P: 230
Nice.
I can't figure out the syntax. I know I am missing something here, or don't have something in the correct spot

Here is what I have.. Does not work
Expand|Select|Wrap|Line Numbers
  1. Shell "xcopy " & """" & "\\Test.com\Test1\Test2\Test3\Test4\SH /EXCLUDE:C:\list-of-excluded-files.txt" & """" & " " & """" & fileName & "SHKB\" & """" & " /y /i /e /d"
Not working... Now it won't even copy the directory. I included in the txt file this:
Expand|Select|Wrap|Line Numbers
  1. ".log"
May 15 '14 #4

Post your reply

Sign in to post your reply or Sign up for a free account.