Difference between revisions of "Transfering files to and from your workstation"

From CUC3
Jump to navigation Jump to search
import>Mp466
 
import>Mp466
Line 2: Line 2:
 
Furthermore you should not be using a system that allows rcp and the like because they send unencrypted passwords.
 
Furthermore you should not be using a system that allows rcp and the like because they send unencrypted passwords.
   
1. scp is on option
+
1. '''scp''' is on option
   
 
The below will transfer a single file ''TEMP''
 
The below will transfer a single file ''TEMP''
Line 9: Line 9:
 
</pre>
 
</pre>
   
The directory will recursivel transfer an entire directory ''DIRECTORY''
+
The directory will recursively transfer an entire directory ''DIRECTORY''
 
<pre>
 
<pre>
 
scp -r ''DIRECTORY'' $USER@$REMOTEHOST:~
 
scp -r ''DIRECTORY'' $USER@$REMOTEHOST:~
 
</pre>
 
</pre>
   
2 rsync is a more powerful utility that will send the differences between files or directories; therefore it can be much quicker than scp. Rsync can also preserve the permissions of the files and directories. Rsync has multiple options so you will need to read the documentation for more details. Rsync is ideal for backups as well.
+
2 '''rsync''' is a more powerful utility that will send the differences between files or directories; therefore it can be much quicker than scp. Like scp it can transferr files within a filesystem or to remote machines. Rsync can also preserve the permissions of the files and directories. Rsync is ideal for backups as well. Rsync has multiple options so you will need to read the documentation for more details via ''info rsync''.
   
 
The directory will recursively transfer an entire directory ''DIRECTORY''
 
The directory will recursively transfer an entire directory ''DIRECTORY''
  +
<pre>
  +
rsync -Pavu ''DIRECTORY'' ''DIRECTORY_1''
  +
</pre>
  +
  +
Only use with ssh.
 
<pre>
 
<pre>
 
rsync -Pavu -e ssh ''DIRECTORY'' $USER@$REMOTEHOST:~
 
rsync -Pavu -e ssh ''DIRECTORY'' $USER@$REMOTEHOST:~
 
</pre>
 
</pre>
  +
  +
Be very careful of the '''--delete''' command. It does what you think will.
  +
  +
The '''--exclude-from''' can be helpful when large binaries or databases need not be transferred.

Revision as of 01:07, 8 July 2008

First off you should only be using programs that use the ssh libraries for transferring files. Furthermore you should not be using a system that allows rcp and the like because they send unencrypted passwords.

1. scp is on option

The below will transfer a single file TEMP

 scp ''TEMP''  $USER@$REMOTEHOST:~

The directory will recursively transfer an entire directory DIRECTORY

 scp -r ''DIRECTORY''  $USER@$REMOTEHOST:~

2 rsync is a more powerful utility that will send the differences between files or directories; therefore it can be much quicker than scp. Like scp it can transferr files within a filesystem or to remote machines. Rsync can also preserve the permissions of the files and directories. Rsync is ideal for backups as well. Rsync has multiple options so you will need to read the documentation for more details via info rsync.

The directory will recursively transfer an entire directory DIRECTORY

 rsync -Pavu  ''DIRECTORY'' ''DIRECTORY_1''

Only use with ssh.

 rsync -Pavu -e ssh ''DIRECTORY''  $USER@$REMOTEHOST:~

Be very careful of the --delete command. It does what you think will.

The --exclude-from can be helpful when large binaries or databases need not be transferred.