3

I'm doing a NAS data migration from a Celerra NS960 to a Unity 500. I have an SMB/CIFS file system I synced using EMCOpy in Windows environment. It's also an NFS (multiprotocol) file system. I have both file systems mounted on a Solaris 10 UNIX server can I just rsync the permissions only from the NS960 to the Unity and not have all the data copy again?

roaima
  • 107,089
  • 14
  • 139
  • 261
  • Given that the accepted answer (over there) bends over backwards to disable recursion (and explains how it does it),  I believe that it’s a dup. – G-Man Says 'Reinstate Monica' Oct 13 '18 at 02:29
  • Well, this seems to be a common meta-problem: Person A asks question X and accepts an answer.   Person B asks question Y which is the same as question X but says “That answer doesn’t work for me.”   What to do, what to do?, as Pooh would say.   Do we tell Person A to earn 100 rep points and put a bounty on question X?   The [SE] system doesn’t seem to handle cases like that well.   Do you believe that I should withdraw my vote (VTC as dup)? – G-Man Says 'Reinstate Monica' Oct 13 '18 at 17:20
  • 2
    Suggested duplicate does not extend from a single directory to a tree of files. The alternative doesn't work on Solaris. Not a duplicate. – roaima Oct 16 '18 at 06:27
  • Related, but also not a dup - [Can rsync fix time stamps without redownloading?](https://unix.stackexchange.com/q/200408/100397) – roaima Oct 04 '22 at 07:06

2 Answers2

0

Interestingly, the question in the linked possible duplicate (which, IMO isn't a dup) gives the clue to an answer that will work for you if you have GNU coreutils that includes cp. Solaris cp doesn't have the --attributes-only option so you can't use this "out of the box".

cp -a --attributes-only srcdir/. dstdir
roaima
  • 107,089
  • 14
  • 139
  • 261
-1

As answered elsewhere, how does:

rsync -ptgo -A -X -d --no-recursive --exclude=* first-dir/ second-dir

not achieve the goal?

As stated,

This does:

-p, --perms                 preserve permissions
-t, --times                 preserve modification times
-o, --owner                 preserve owner (super-user only)
-g, --group                 preserve group
-d, --dirs                  transfer directories without recursing
-A, --acls                  preserve ACLs (implies --perms)
-X, --xattrs                preserve extended attributes
    --no-recursive          disables recursion

For reference

    --no-OPTION             turn off an implied OPTION (e.g. --no-D)
-r, --recursive             recurse into directories
brunobhr
  • 91
  • 9
  • This applies to a single directory, not to a tree of files as described in the question. Scenario `mkdir -p a a/b; touch a/a1 a/b/b1 a/b/b2; cp -r a x; touch -t 201810130000 $(find a -depth)` source is `a` target is `x`. – roaima Oct 13 '18 at 14:26
  • Does it *work* (i.e., do what this OP wants) for a single directory? Could it be successfully coupled with ```find -type d -exec```? – G-Man Says 'Reinstate Monica' Oct 13 '18 at 17:20
  • @G-Man it affects the directory, not its files. – roaima Oct 13 '18 at 17:53