10-31-2012 07:17 AM
Is there a way to copy multiple folders and sub folders and keep permissions? I have mulitple folders and each one has subfolders in them, I need to keep owners , groups, permission, etc. This is for a go-live on a new server.
i know scp and rcp doesnt keep permissions, and i cant tar this stuff up due to size..
10-31-2012 07:49 AM
> [...] i cant tar this stuff up due to size..
That might depend on exactly what "tar this stuff up" means to you.
> [...] a new server [...]
Not a very detailed description of anything.
A common method is a "tar" pipeline, which does not require saving a
giant "tar" archive anywhere. For example:
( cd src ; tar cf - dir ) | ( cd dst ; tar xf - )
This simple example depends on transparent access to the source and
destination file systems. NFS can help for a remote system, or
rsh/remsh or ssh can be used on one side or the other. Compression
(typically bzip2 or gzip) can be added (to both sides), if the CPUs are
faster than the interconnection. GNU "tar" or pax may be needed if the
native "tar" program has troubling file-size or name-length limits.
More complex examples abound on the Web (or even on this forum, although
older ones may have been lost in the Great Forum Upgrade).
10-31-2012 10:00 AM - edited 10-31-2012 10:00 AM
Even after years of complaining openssh(secure shell) scp -rp command does not preserve ownership and permissions.
What might is doing a read-write NFS mount of the destimation file system and doing a cp -rp command. That command seems to do abetter job.
Or using tar to do the job in smaller chunks, though that is clunky.
Owner of ISN Corporation