This can be used to ensure when copying data that the directory permissions are set correctly.
Suppose the following command is issued as the root user:
find /data/source/myApp -name *.java -print |\ cpio -pdvum /backup/myApp/20100117
This will copy all *.java files in all underlying directories from /data/source/myApp to the /backup/myApp/20100117 directory, but all directories will have the ownership of the root user and the permissions will be set accordingly to the umask of the root user. All *.java files will have the correct permissions and ownership.
When using the directories command as the following example:
find /data/source/myApp -name *.java -print | directories |\ cpio -pdvum /backup/myApp/20100117
all permissions and all ownership will be correct.
This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.