Copying files: Difference between revisions

From DISI
Jump to navigation Jump to search
(Created page with "To copy from the machine you are on tar czf - dir1 dir2 dir3 | ssh tbalius@sgehead.bkslab.org "tar xzf - -C path/for/new/files " To copy from a remote machine to the machi...")
 
No edit summary
Line 1: Line 1:
One way to copy files to and from a machine is as follows:
To copy from the machine you are on
To copy from the machine you are on


  tar czf - dir1 dir2 dir3 | ssh tbalius@sgehead.bkslab.org "tar xzf - -C path/for/new/files "
  tar czf - dir1 dir2 dir3 | ssh tbalius@sgehead.bkslab.org "tar xzf - -C path/for/new/files "


To copy from a remote machine to the machine you are on
To copy from a remote machine to the machine you are on


  ssh tbalius@sgehead.uoft.bkslab.org "cd path/to/dir/you/want ; tar czf - diryouwant1 diryouwant2 " | tar xzf - -C where/it/goes/locally
  ssh tbalius@sgehead.uoft.bkslab.org "cd path/to/dir/you/want ; tar czf - diryouwant1 diryouwant2 " | tar xzf - -C where/it/goes/locally


 
This has advantages that it does not copy symbolic links. 
It also compresses the data while copying


Clear?
Clear?


[[Category:Internal]]
[[Category:Internal]]

Revision as of 21:08, 6 June 2014

One way to copy files to and from a machine is as follows:

To copy from the machine you are on

tar czf - dir1 dir2 dir3 | ssh tbalius@sgehead.bkslab.org "tar xzf - -C path/for/new/files "

To copy from a remote machine to the machine you are on

ssh tbalius@sgehead.uoft.bkslab.org "cd path/to/dir/you/want ; tar czf - diryouwant1 diryouwant2 " | tar xzf - -C where/it/goes/locally

This has advantages that it does not copy symbolic links. It also compresses the data while copying

Clear?