samuelhauser
2/19/2015 - 9:58 AM

How to copy files from one machine to another using ssh

# To copy a file from B to A while logged into B:
scp /path/to/file username@a:/path/to/destination

# To copy a file from B to A while logged into A:
scp username@b:/path/to/file /path/to/destination
# excluding folders or files

# To copy a file from B to A while logged into A:
rsync -r username@b:/path/to/file /path/to/destination --exclude 'folder1/' --exclude 'folder2/' --exclude 'file.php'