我尝试从外部机器 scp 到我的机器但失败了:
$ scp -rp /home/externaluser/pd/folder myIP:pd/
scp: pd/: File exists
我已经检查过权限:
$ ls -l /home/externaluser/
lrwxrwxrwx 1 externaluser externaluser 56 Mar 3 17:42 pd -> /run/media/superuser/external_xfs_hd/pd
文件夹是空的:
$ ll /run/media/superuser/external_xfs_hd/pd
total 0
奇怪的是,如果我将 scp 到 /home/externaluser 然后它就可以工作了:
$ scp -rp /home/externaluser/pd/folder myIP:
任何想法?
更新 #1: 按照 Danfossi 的建议尝试 rsync:
$ rsync -avz -e ssh /home/externaluser/pd externaluser@myIP:/home/externaluser/pd
sending incremental file list
rsync: ERROR: cannot stat destination "/home/externaluser/pd": Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(565) [Receiver=3.0.9]
rsync: connection unexpectedly closed (187 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]
$
以下是已安装的外部驱动器的信息:
$ df -T /dev/sdb
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sdb xfs 1952560720 32992 1952527728 1% /run/media/superuser/external_xfs_hd
当我点击它时,它被 nautilus 安装。
答案1
尝试使用 rsync:
$ rsync -avz -e ssh /src/dir [email protected]:dst/dir
或者使用 tar:
$ cd /source_dir
$ tar cf - * | ssh [email protected] ‘(cd /destination_dir;tar xf - )’