Here is a nice set of commands to send a directory from one server to another, with tar, so you can preserve permission (-p option) and use compression (network optimization).
Voici une petite combinaison de commandes sympathique pour envoyer un répertoire d’un serveur à un autre avec tar, pour conserver les priorités (-p) et utiliser la compression (optimisation du flux réseau).
His commands archive, compress, send and unachive, uncompress the directory on the fly.
La commande archive, compresse, envoie et désarchive, décompresse à la volée le répertoire.
# gtar czvfp - wordpress | ssh myhost1.mydomain "cd /tmp; gtar xzvfp -"
The same thing can be done the other way around (from server target):
Cela fonctionne aussi dans l’autre sens (depuis le serveur cible de la copie) :
# ssh myhost2.mydomain "cd /tmp; gtar czvfp - wordpress " |gtar xzvfp -
ssh can ben replaced with remsh if you have to.
Vous pouvez remplacer ssh par remsh au besoin.