CentOS 7 Data Migration Using SCP Commands

1. Install scp

yum install -y openssh-clients

2. Command parameters

OPTIONS:
-v has the same meaning as -v in most linux commands and is used to display progress. Can be used to view connection, authentication, or configuration errors
-C enable compression option
-P select port

-r copy directory

3. Command

  1. Copy file (local >> remote): scp /cloud/data/test.txt [email protected]:/cloud/data/
  2. Copy file (remote >> remote): scp [email protected] :/cloud/data/test.txt /cloud/data/
  3. Copy directory (local >> remote): scp -r /cloud/data [email protected] :/cloud/data/
  4. Copy directory (remote >> local): scp -r [email protected] :/cloud/data/ /cloud/data/


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324882026&siteId=291194637