6 Replies Latest reply on Feb 21, 2013 12:09 PM by Rob Fernie

    dsync exclusions

      I'm trying to set up dsync in an NSH script using the -X exclusion parameter, but I seem to be struggling with the format. So far I haven't found any documented examples of its use. Could someone provide a working example? My goal is to exclude multiple paths under the top directory.

       

      I am using BL 8.2.02.321.

        • 1. Re: dsync exclusions

          Hi Rob,

           

          The proper way to use the dsync with -X argument is as follows

           

          dsync -X "Exclusion1" [-X "Exclusion2"] ORIG DEST

           

          Where the Exclusions are wildcarded, for example /D/Folder/* would exlude all FILES inside "/D/Folder", if you want to exclude all the folders inside /D/Folder, you need to end the exclusion string with a "/" --> /D/Folder/*/

          If you want to exclude only a folder you would use -X /D/Folder/

           

          Same syntax for the Include (-I) arguments

           

          Hope this helps!

          Jose

          • 2. Re: dsync exclusions

            For your specific case it would go:

             

            /D/FolderToCopy/Folder1

            /D/FolderToCopy/Folder2

            /D/FolderToCopy/FolderExclude1

            /D/FolderToCopy/Folder3

            /D/FolderToCopy/FolderExclude2

             

            dsync -X "/D/FolderToCopy/FolderExclude1/" -X "/D/FolderToCopy/FolderExclude2/" //Host1/D/FolderToCopy //Host2/Destination

            • 3. Re: dsync exclusions

              Sorry, my bad, you don't need to specify the full path to the directories to exclude, they need to be relative to the folder you want to syncronize

               

              So:

               

              dsync -X "/FolderExclude1/" -X "/FolderExclude2/" //Host1/D/FolderToCopy //Host2/Destination

              1 of 1 people found this helpful
              • 4. Re: dsync exclusions

                Interesting. Okay, this is working using the exact syntax that you used. But when I did use the absolute path, it stopped working. Is it not possible to use an absolute path?

                 

                This command:

                 

                dsync -dmo -X

                 

                "/tmp/dsync_test/FolderExclude2/" -X "/FolderExclude1/" //he3lnxl119/tmp/dsync_test //he3lnxl120/tmp/dsync_test

                 

                properly excluded FolderExclude1 but copied FolderExclude2 and its contents

                 

                • 5. Re: dsync exclusions

                  I believe the excluded paths are computed relatively to the folder to be copied, thus if you include the full path it would mean to try to exclude

                   

                  //he3lnxl119/tmp/dsync_test/tmp/dsync_test/FolderExclude2/

                   

                  which doesn't exist ...

                  • 6. Re: dsync exclusions

                    Aha! Yes, that appears to be the key. So I can give a precise directory so long as I work relative to the folder specified for copying.

                     

                    So for example, to exclude:

                    /tmp/dsync_test/full/path/FolderExclude2

                     

                    It worked to use:

                    -X  "/full/path/FolderExclude2/"

                     

                    The result was that /tmp/dsync_test/full/path was properly copied, and FolderExclude2 was properly excluded

                     

                    Thanks!