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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anoble1
    New Member
    • Jul 2008
    • 246

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

    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:

    Code:
    Shell "xcopy " & """" & "\\Test.com\Test1\Test2\Test3\Test4\Apps" & """" & " " & """" & fileName & "Test4\Apps\" & """" & " /y /i /e /d"
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    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:filenam e1[+[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}l ist_of_exclusio ns.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.
    Last edited by zmbd; May 15 '14, 06:29 PM. Reason: [z{update}]

    Comment

    • pod
      Contributor
      • Sep 2007
      • 298

      #3
      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

      Comment

      • anoble1
        New Member
        • Jul 2008
        • 246

        #4
        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
        Code:
        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:
        Code:
        ".log"
        Last edited by anoble1; May 15 '14, 07:20 PM. Reason: Add

        Comment

        Working...