In copying a directory which contains files and sub-directories and symlinks >from one system to another, to retain symlinks as symlinks, I usually enter >the directory on the sending system and extract it on the receiving system
as follows:
tar cf - * | ssh user@host '(cd /path/to/directory;tar xf - )'
File permissions are mostly kept on the receiving system as their originals. >For example, when in the sending system there's a file:
You want to use "p" when extracting.
tar cf - * | ssh user@host '(cd /path/to/directory;tar xpf - )'
Generally, tar will create a file with the permissions in the archive, >however the system will apply the umask (likely 022) and apply that so
a file mode 777 will be extracted in mode 755.
With "-p" it should take the original modes.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 286 |
Nodes: | 16 (2 / 14) |
Uptime: | 89:42:39 |
Calls: | 6,496 |
Calls today: | 7 |
Files: | 12,100 |
Messages: | 5,277,448 |