在作为cron作业执行时,将SCP消息重定向到文件时出现问题:
(scp -q ${locationsFromTo[$i]} ${locationsFromTo[$i+1]}) >> $logFile 2>&1;
有没有办法将SCP错误重定向到文件?
下面是脚本:
#!/bin/bash
#The script scp the files from a remote server
#The script will run only for ($sleepTime * $maxIterations) before exiting (default: 120 ite
我希望定期将文件从Linux机器复制到Windows机器(这两台机器都是远程访问的)。
假设我有以下内容。Linux机器名为host1,用户名为user1,Windows机器名为host2,用户名为user2。windows机器还具有登录密码。
我想将文件从/home/admin of host1复制到D:\admin of host2。
有人能帮我创建一个shell脚本来执行这个任务吗?
当我们试图将文件从windows服务器复制到linux时,出现以下错误:
command: scp C:\Users\arya\Videos\aaa userabc@10.100.10.10:/local/
scp command getting failed : Unable to negotiate with 10.100.10.10 port 55: no matching host key type found. Their offer: ssh-rsa,ssh-dss
有什么方法可以从windows复制到linux服务器并减少密码?
我有一个bash脚本,里面有一些scp命令。它运行得很好,但是,如果我尝试用"./myscript.sh >log“重定向我的stdout,那么只有我的显式回波显示在"log”文件中。scp输出缺失。
if $C_SFTP; then
scp -r $C_SFTP_USER@$C_SFTP_HOST:$C_SOURCE "$C_TMPDIR"
fi
好吧,我现在该怎么办?谢谢