Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-15445

SCP Task Recursive copy doesn't work if only one folder has files.

      This may be expected behavior, if so feel free to close.

      We were trying to recursive copy files to maintain folder structure, but in one instance all of the files were under the same subfolder so the plugin didn't see it as a recursive copy.

      Works fine

      Matcher: **/*
      dir1/subdir1/file1
      dir1/subdir2/file2
      

      Not viewed as recursive

      Matcher: **/*
      dir1/subdir1/file1
      dir1/subdir1/file2
      

      As a workaround, we added a useless file under dir1 which caused the plugin to view it as a recursive copy.

            [BAM-15445] SCP Task Recursive copy doesn't work if only one folder has files.

            Reproduced by Tony Scott steps

            Alexey Chystoprudov added a comment - Reproduced by Tony Scott steps

            toscott added a comment - - edited

            We have not yet upgraded to 5.10+ so I can't be certain, but the problem occurred when the directory structure being copied only had files in one folder. A test mimicking this behavior would be:

            rm -rf dir1
            mkdir dir1
            cd dir1
            mkdir dir11
            mkdir dir12
            echo "hi1" > dir11/echo1.txt
            echo "hi2" > dir11/echo2.txt
            

            The result of the SCP task on the remote server copying **/* to ~/ to would result as

            ~/echo1.txt
            ~/echo2.txt
            instead of 
            ~/dir1/dir11/echo1.txt
            ~/dir1/dir11/echo1.txt
            

            toscott added a comment - - edited We have not yet upgraded to 5.10+ so I can't be certain, but the problem occurred when the directory structure being copied only had files in one folder. A test mimicking this behavior would be: rm -rf dir1 mkdir dir1 cd dir1 mkdir dir11 mkdir dir12 echo "hi1" > dir11/echo1.txt echo "hi2" > dir11/echo2.txt The result of the SCP task on the remote server copying **/* to ~/ to would result as ~/echo1.txt ~/echo2.txt instead of ~/dir1/dir11/echo1.txt ~/dir1/dir11/echo1.txt

            Alexey Chystoprudov added a comment - - edited

            Can't reproduce it on Bamboo 5.10.1.1 with bamboo-scp-plugin 5.8.5, so it might be solved by plugin upgrade

            Can't reproduce it on Bamboo 5.10.1.1 and bamboo-scp-plugin 5.8.5
            Created Script task

            rm -rf dir1
            mkdir dir1
            cd dir1
            mkdir dir11
            mkdir dir12
            echo "hi1" > dir11/echo1.txt
            echo "hi2" > dir12/echo2.txt
            

            Created SCP task:

            Executed plan and then checked destination folder. All folders are there with correct structure

            Alexey Chystoprudov added a comment - - edited Can't reproduce it on Bamboo 5.10.1.1 with bamboo-scp-plugin 5.8.5, so it might be solved by plugin upgrade Can't reproduce it on Bamboo 5.10.1.1 and bamboo-scp-plugin 5.8.5 Created Script task rm -rf dir1 mkdir dir1 cd dir1 mkdir dir11 mkdir dir12 echo "hi1" > dir11/echo1.txt echo "hi2" > dir12/echo2.txt Created SCP task: Executed plan and then checked destination folder. All folders are there with correct structure

              jmajkutewicz Jan Majkutewicz (Inactive)
              a5bc8484f526 toscott
              Affected customers:
              4 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: