-
Notifications
You must be signed in to change notification settings - Fork 0
/
transfer-datas.mq
37 lines (19 loc) · 1.1 KB
/
transfer-datas.mq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
The syntax for scp is:
If you are on the computer from which you want to send file to a remote computer:
scp /file/to/send username@remote:/where/to/put
Here the remote can be a FQDN or an IP address.
On the other hand if you are on the computer wanting to receive file from a remote computer:
scp username@remote:/file/to/send /where/to/put
scp can also send files between two remote hosts:
scp username@remote_1:/file/to/send username@remote_2:/where/to/put
So the basic syntax is:
scp username@source:/location/to/file username@destination:/where/to/put
You can read man scp to get more ideas on this.
=======
You can use rsync as an alternative. It is mainly for syncing files.. but you can use it for this purpose as well.
rsync -avzh --stats --progress remoteuser@remoteip localpath
to add ssh options:
rsync -e "ssh -P $port_value" remoteuser@remoteip localpath
--progress and --stats are useful for real-time display of transfer.
https://bash.cyberciti.biz/backup/shell-script-to-mirror-backups-to-another-server-in-pull-mode-using-rsync/
Rsync from server to backup server with SSH keys and BWlimit