我阅读了有关 rsync 的信息,但我想问如何通过 rsync 执行以下操作:
我有两个文件在不同的机器(UNIX-AIX)上并且具有相同的名称。
server1 : ..../file.txt
server2 : ..../file.txt
我想在两台服务器中应用以下内容,以确保file.txt
每台服务器上都有最新版本。
服务器1:
if (mod-time[file.txt (on server 1] > mod-time[file.txt (on server2)] )
{
update file.txt (on server 2 ) to become as file.txt (on server 1) ;
}
else
{
skip ;
}
服务器2:
if (mod-time[file.txt (on server2)] > mod-time[file.txt (on server1)] )
{
update file.txt (on server 1 ) to become as file.txt (on server 2) ;
}
else
{
skip ;
}