[英]copy pscp a file from window server to to remote linux server
我想将Windows服务器上的目录(pscp)复制到Linux服务器每次,Linux服务器上的目标地名都必须是新的。当我运行以下命令时,
> pscp -p -l root
> -pw mypassword -r C:\ProgramFiles\Mybackups\root@linux_server:/root/mywindowsbackups/$(date)
命令替换$(date)不起作用。 有人可以建议我如何运行吗?
请尝试以下操作:
:: This is stripping the `/` and `Day of the Week` from the date
set target_date=%date:/=-%
set target_date=%target_date:* =%
:: Copying the directory to the linux server based on this system's date
pscp -p -l root
-pw mypassword -r C:\ProgramFiles\Mybackups\root@linux_server:/root/mywindowsbackups/%target_date%
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.