Find all subfolders and copy their contents

164 Views Asked by At

Currently I have the following code for copying all folders to a new location:

find /var/CommuniGate/Accounts/ -name 'Archive.folder' | cpio -pdm archiv_mount/

It works fine, but only copies the Archive.folder. How can I also copy everything that is contained in Archive.folder?

1

There are 1 best solutions below

0
On

With find you can execute some commands, for example copy with recursion:

find /var/CommuniGate/Accounts/ -name 'Archive.folder' -exec cp -Rp {} archiv_mount/ \;