For when #scp doesn’t work so well, e.g. preserving users:

«# Be paranoid about tar not supporting the -C option. sudo tar cf - somedirectory | ssh host sudo bash -c “‘cd someotherdirectory && tar xf -'"»

#ssh #shell #unix #sysadmin #tar #bash