scp

001-linux scp文件拷贝

拟墨画扇 提交于 2020-01-05 19:48:32
  scp是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的。可能会稍微影响一下速度。当你服务器硬盘变为只读 read only system时,用scp可以帮你把文件移出来。另外,scp还非常不占资源,不会提高多少系统负荷,在这一点上,rsync就远远不及它了。虽然 rsync比scp会快一点,但当小文件众多的情况下,rsync会导致硬盘I/O非常高,而scp基本不影响系统正常使用。 1.命令格式:   scp [参数] [原路径] [目标路径] 2.命令功能:   scp是 secure copy的缩写, scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令。linux的scp命令可以在linux服务器之间复制文件和目录。 3.命令参数:   -1 强制scp命令使用协议ssh1   -2 强制scp命令使用协议ssh2   -4 强制scp命令只使用IPv4寻址   -6 强制scp命令只使用IPv6寻址   -B 使用批处理模式(传输过程中不询问传输口令或短语)   -C 允许压缩。(将-C标志传递给ssh,从而打开压缩功能)   -p 保留原文件的修改时间,访问时间和访问权限。   -q 不显示传输进度条。   -r 递归复制整个目录。   -v

对比cp和scp命令 将数据从一台linux服务器复制到另一台linux服务器

我的未来我决定 提交于 2020-01-05 19:45:22
cp命令 用来将一个或多个源文件或者目录复制到指定的目的文件或目录。它可以将单个源文件复制成一个指定文件名的具体的文件或一个已经存在的目录下。cp命令还支持同时复制多个文件,当一次复制多个文件时,目标文件参数必须是一个已经存在的目录,否则将出现错误。 -a:此参数的效果和同时指定"-dpR"参数相同; -d:当复制符号连接时,把目标文件或目录也建立为符号连接,并指向与源文件或目录连接的原始文件或目录; -f:强行复制文件或目录,不论目标文件或目录是否已存在; -i:覆盖既有文件之前先询问用户; -l:对源文件建立硬连接,而非复制文件; -p:保留源文件或目录的属性; -R/r:递归处理,将指定目录下的所有文件与子目录一并处理; -s:对源文件建立符号连接,而非复制文件; -u:使用这项参数后只会在源文件的更改时间较目标文件更新时或是名称相互对应的目标文件并不存在时,才复制文件; -S:在备份文件时,用指定的后缀“SUFFIX”代替文件的默认后缀; -b:覆盖已存在的文件目标前将目标文件备份; -v:详细显示命令执行的操作。 如果把一个文件复制到一个目标文件中,而目标文件已经存在,那么,该目标文件的内容将被破坏。此命令中所有参数既可以是绝对路径名,也可以是相对路径名。通常会用到点 . 或点点 .. 的形式。例如,下面的命令将指定文件复制到当前目录下: cp ../mary

scp 将数据从一台linux服务器复制到另一台linux服务器

大兔子大兔子 提交于 2020-01-05 19:44:40
scp 是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且 scp传输是加密的。可能会稍微影响一下速度。当你服务器硬盘变为只读 read only system时,用scp可以帮你把文件移出来。另 外,scp还非常不占资源,不会提高多少系统负荷,在这一点上,rsync就远远不及它了。虽然 rsync比scp会快一点,但当小文件众多的情况 下,rsync会导致硬盘I/O非常高,而scp基本不影响系统正常使用。 1.命令格式: scp [参数] [原路径] [目标路径] 2.命令功能: scp是 secure copy的缩写, scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令。linux的scp命令可以在linux服务器之间复制文件和目录。 3.命令参数: -1 强制scp命令使用协议ssh1 -2 强制scp命令使用协议ssh2 -4 强制scp命令只使用IPv4寻址 -6 强制scp命令只使用IPv6寻址 -B 使用批处理模式(传输过程中不询问传输口令或短语) -C 允许压缩。(将-C标志传递给ssh,从而打开压缩功能) -p 保留原文件的修改时间,访问时间和访问权限。 -q 不显示传输进度条。 -r 递归复制整个目录。 -v 详细方式显示输出。scp和ssh(1

scp命令详解

∥☆過路亽.° 提交于 2020-01-05 19:44:11
scp是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的。可能会稍微影响一下速度。当你服务器硬盘变为只读 read only system时,用scp可以帮你把文件移出来。另外,scp还非常不占资源,不会提高多少系统负荷,在这一点上,rsync就远远不及它了。虽然 rsync比scp会快一点,但当小文件众多的情况下,rsync会导致硬盘I/O非常高,而scp基本不影响系统正常使用。 1.命令格式: scp [参数] [原路径] [目标路径] 2.命令功能: scp是 secure copy的缩写, scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令。linux的scp命令可以在linux服务器之间复制文件和目录。 3.命令参数: -1 强制scp命令使用协议ssh1 -2 强制scp命令使用协议ssh2 -4 强制scp命令只使用IPv4寻址 -6 强制scp命令只使用IPv6寻址 -B 使用批处理模式(传输过程中不询问传输口令或短语) -C 允许压缩。(将-C标志传递给ssh,从而打开压缩功能) -p 保留原文件的修改时间,访问时间和访问权限。 -q 不显示传输进度条。 -r 递归复制整个目录。 -v 详细方式显示输出。scp和ssh(1

broken pipe with remote rsync between two servers

倖福魔咒の 提交于 2020-01-05 08:11:21
问题 I am trying to transfer a large dataset (768 Gigs) from one remote machine to another using bash on ubuntu 16.04. The problem I appear to be having is that I use rsync and the machine will transfer for a few hours and then quit when the connection inevitably gets interrupted. So suppose Im on machine A and the remote servers are machines B and C (all machines using ubuntu 16.04). I ssh to machine B and use this command: nohup rsync -P -r -e ssh /path/to/files/on/machine_B user@machine_C

broken pipe with remote rsync between two servers

随声附和 提交于 2020-01-05 08:10:13
问题 I am trying to transfer a large dataset (768 Gigs) from one remote machine to another using bash on ubuntu 16.04. The problem I appear to be having is that I use rsync and the machine will transfer for a few hours and then quit when the connection inevitably gets interrupted. So suppose Im on machine A and the remote servers are machines B and C (all machines using ubuntu 16.04). I ssh to machine B and use this command: nohup rsync -P -r -e ssh /path/to/files/on/machine_B user@machine_C

Quote spaces in filename when calling subprocess

家住魔仙堡 提交于 2020-01-05 01:32:12
问题 Somebody came up with the brilliant idea of putting spaces in a filename. I need to do scp from python using that filename, which is problematic because the shell parses the command, and scp has also some quircks regarding spaces. This is my test code: import subprocess import shlex def split_it(command): return shlex.split(command) #return command.split(" ") def upload_file(localfile, host, mypath): command = split_it('scp {} {}:"{}"'.format(localfile, host, mypath)) print(command) res =

golang scp file using crypto/ssh

痴心易碎 提交于 2020-01-04 04:18:11
问题 I'm trying to download a remote file over ssh The following approach works fine on shell ssh hostname "tar cz /opt/local/folder" > folder.tar.gz However the same approach on golang giving some difference in output artifact size. For example the same folders with pure shell produce artifact gz file 179B and same with go script 178B. I assume that something has been missed from io.Reader or session got closed earlier. Kindly ask you guys to help. Here is the example of my script: func

kaldi 中train_mono.sh分析

烂漫一生 提交于 2020-01-04 03:14:29
$cmd JOB=1 $dir/log/init.log \ gmm-init-mono $shared_phones_opt "--train-feats=$feats subset-feats --n=10 ark:- ark:-|" $lang/topo $feat_dim \ $dir/0.mdl $dir/tree || exit 1; 训练结果是生成0.mdl和tree 查看0.mdl方法 ~/williamli/project/kaldi/kaldi/src/gmmbin/gmm-copy --binary=false 0.mdl - 输出结果 第一部分 <TransitionModel> <Topology> <TopologyEntry> <ForPhones> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 显示出音素的个数,这里音素用序列号代表 第二部分 <TransitionModel> <Topology> <TopologyEntry> <ForPhones> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 <TransitionModel> <Topology> <TopologyEntry>

The @ in a for loop while using scp

浪尽此生 提交于 2020-01-03 17:13:10
问题 Please take a look at this line: ${server_username}:${server_password}@@{server}:/tmp The double @@ causes problems. Instead of user:pass@server it displays as user:passserver and therefore is unable to connect to the remote ssh server. How do you tell ant to leave the @ be? This is my code: <for list="${externalLibs}" param="library"> <sequential> <for list="${servers}" param="server"> <sequential> <echo> Copying @{library} to @{server} ${server_username}:${server_password}@@@{server}:/tmp/@