Transfer

· notat's blog


Transfer Files Between Remote and Local Systems Over SSH

scp #

Copy file

scp username@ip_address:/home/username/filename

Copy Directory

scp -r source_dir username@ip_address:/home/username/target_dir

rsync #

sync a directory from a local machine to a remote machine

rsync -avzh /root/rpmpkgs root@192.168.0.141:/root/

single file

rsync filename username@ip_address:/home/username

sync a remote directory to a local directory

rsync -avzh root@192.168.0.141:/root/rpmpkgs /tmp/myrpms

Using recursive

rsync -r - - -

Rsync using SSH #

Copy a File from a Remote Server to a Local Server with SSH

rsync -avzhe --progress ssh root@192.168.0.141:/root/anaconda-ks.cfg /tmp

Copy a File from a Local Server to a Remote Server with SSH

rsync -avzhe --progress ssh backup.tar.gz root@192.168.0.141:/backups/

Dry Run

--dry-run