我正在尝试从表单中获取输入并将其保存到与html文件位于同一文件夹中的文本文件中.这是我到目前为止:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Reservation</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<script>
function writeToFile(item, name, time)
{
alert("Hello " + item);
var fso = new ActiveXObject("Scripting.FileSystemObject");
var fh = fso.OpenTextFile("E:/labChart/etc/reserve.text", 8);
fh.WriteLine(item);
fh.Close();
}
function readFile()
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var fh = fso.OpenTextFile("reserve.text", 1, false, 0);
var lines = "";
while (!fh.AtEndOfStream) {
lines += fh.ReadLine() + "\r";
}
fh.Close();
return lines;
}
</script>
</head>
<body>
Reservation
<br> …Run Code Online (Sandbox Code Playgroud)在我的linux服务器上,运行以下命令:
sshpass -p 'password' rsync -avz /source/folder/ root@192.168.x.x:/dest/folder
Run Code Online (Sandbox Code Playgroud)
当我运行不带sshpass的命令时,它将为我提供有关主机和密码真实性的提示。
我需要一些等效于“ -o StrictHostKeyChecking = no”(用于ssh)的工具,它可以使我在没有任何提示或错误的情况下运行它。
我从谷歌搜索中看到的所有内容都是关于ssh引发错误而不是rsync的。