如何将文件从一台服务器复制到另一台服务器?我有3台服务器,必须从中选择将文件从一台服务器复制到另一台服务器。我知道scp是要使用的命令,但我只是想知道如何编写Shell脚本,该脚本使我可以选择将文件从一台服务器复制到另一台服务。任何帮助表示赞赏。
答案 0 :(得分:0)
我会写一个脚本,
list_of_things=(one two three)
first_argument=$0
second_argument=$1
if [ -e first_argument ]
scp
将文件传输到每个服务器。 for item IN list_of_things; do
// do something here
then
通读bash脚本教程以获取更多指导:https://ryanstutorials.net/bash-scripting-tutorial/