linux:rsync

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:rsync [2024/03/14 12:06] – [ローカルディレクトリ → ローカルディレクトリ (ディスク間コピーなど)] ともやんlinux:rsync [2024/03/14 12:32] (現在) – [rsyncコマンドの元ディレクトリ指定の違いによる動作] ともやん
行 43: 行 43:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avz --delete -e</b> ssh ローカルディレクトリ ユーザ@リモートサーバ:転送先フォルダ+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avz</font> <font color="#A347BA">--delete</font> <font color="#A347BA">-e</font> ssh ローカルディレクトリ ユーザ@リモートサーバ:転送先フォルダ
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 61: 行 61:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avz --delete -e</b> ssh ユーザ@リモートサーバ:バックアップ元ディレクトリ ローカルバックアップ先ディレクトリ+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avz</font> <font color="#A347BA">--delete</font> <font color="#A347BA">-e</font> ssh ユーザ@リモートサーバ:バックアップ元ディレクトリ ローカルバックアップ先ディレクトリ
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 68: 行 68:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avz --delete -e</b> "ssh -p10022ユーザ@リモートサーバ:バックアップ元ディレクトリ ローカルバックアップ先ディレクトリ+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avz</font> <font color="#A347BA">--delete</font> <font color="#A347BA">-e</font<font color="#A2734C">&quot;ssh -p10022&quot;</font> ユーザ@リモートサーバ:バックアップ元ディレクトリ ローカルバックアップ先ディレクトリ
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 75: 行 75:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avz --delete -e</b> ssh username@remote.server.com:/remote/server/directory/ /local/client/directory/20081016+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avz</font> <font color="#A347BA">--delete</font> <font color="#A347BA">-e</font> ssh username@remote.server.com:/remote/server/directory/ /local/client/directory/20081016
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
行 88: 行 88:
 sent 2594 bytes  received 403518 bytes  14767.71 bytes/sec sent 2594 bytes  received 403518 bytes  14767.71 bytes/sec
 total size is 140703092  speedup is 346.46 total size is 140703092  speedup is 346.46
-</pre></html></WRAP> 
-<WRAP color_command><html><pre> 
-<b class=GRN>$</b> 
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 105: 行 102:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avz --delete -e</b> ssh username@remote.server.com:/remote/server/directory/ /local/client/directory/20081016+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avz</font> <font color="#A347BA">--delete</font> <font color="#A347BA">-e</font> ssh username@remote.server.com:/remote/server/<b class=DiYE>directory</b><b class=RED>/</b> /local/client/directory/20081016
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
-/remote/server/directory<html><span style="color: red">/</span></html> のように、元ディレクトリの最後に "<html><span style="color: red">/</span></html>" を付けると、directory の内容が 20081016 内に展開されるかたちで同期される🤔\\+<html><code>/remote/server/<b class=RED>directory/</b></code></html> のように、元ディレクトリの最後に "<html><code><b class=RED>/</b></code></html>" を付けると、<html><code>directory</code></html> の内容が <html><code>20081016</code></html> 内に展開されるかたちで同期される🤔\\
 \\ \\
 先ディレクトリに元ディレクトリ名のディレクトリが作成される例: 先ディレクトリに元ディレクトリ名のディレクトリが作成される例:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avz --delete -e</b> ssh username@remote.server.com:/remote/server/directory /local/client/directory/20081016+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avz</font> <font color="#A347BA">--delete</font> <font color="#A347BA">-e</font> ssh username@remote.server.com:/remote/server/<b class=DiYE>directory</b> /local/client/directory/20081016
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
-/remote/server/<html><span style="color: red">directory</span></html> のように、元ディレクトリの最後に "<html><span style="color: red">/</span></html>" を付けないと、20081016 内に directory が作成されてその中に同期される🤔\\+<html><code>/remote/server/<b class=RED>directory</b></code></html> のように、元ディレクトリの最後に "<html><code><b class=RED>/</b></code></html>" を付けないと、<html><code>20081016</code></html> 内に <html><code>directory</code></html> が作成されてその中に同期される🤔\\
  
 ===== rsync でレジューム同期を行うには? ===== ===== rsync でレジューム同期を行うには? =====
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avzP --delete -e</b> ssh user@remote.srv.com:/remote/server/directory/ /local/client/directory/20150804+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avzP</font> <font color="#A347BA">--delete</font> <font color="#A347BA">-e</font> ssh user@remote.srv.com:/remote/server/directory/ /local/client/directory/20150804
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 132: 行 129:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avzP --delete --no-inc-recursive -e</b> ssh user@remote.srv.com:/remote/server/directory/ /local/client/directory/20150804+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avzP</font> <font color="#A347BA">--delete</font> <font color="#A347BA">--no-inc-recursive</font> <font color="#A347BA">-e</font> ssh user@remote.srv.com:/remote/server/directory/ /local/client/directory/20150804
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 148: 行 145:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>sudo</b> rsync <b class=HIK>-avz --delete -e</b> ssh user@remote.server.com:/remote/server/directory/ /local/client/directory/+<font color="#FF8700"><b>$</b></font> <font color="#26A269"><u style="text-decoration-style:single">sudo</u></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avz</font> <font color="#A347BA">--delete</font> <font color="#A347BA">-e</font> ssh user@remote.server.com:/remote/server/directory/ /local/client/directory/
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 158: 行 155:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-$ mkdir -p /var/www/html/+<font color="#FF8700"><b>$</b></font> <font color="#26A269">mkdir</font> <font color="#A347BA">-p</font> <u style="text-decoration-style:single">/var/www/html/</u>
 </pre></html></WRAP> </pre></html></WRAP>
 </WRAP> </WRAP>
行 166: 行 163:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avz --delete -e</b> /var/www/vhosts/ '/mnt/win_c-drv/Program Files (x86)/Ampps/www/vhosts/'+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avz</font> <font color="#A347BA">--delete</font> <font color="#A347BA">-e</font> /var/www/vhosts/ <font color="#A2734C">&apos;/mnt/win_c-drv/Program Files </font><font color="#12488B"><b>(</b></font><font color="#A2734C">x86</font><font color="#12488B"><b>)</b></font><font color="#A2734C">/Ampps/www/vhosts/&apos;</font>
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
行 184: 行 181:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-avz --delete</b> /var/www/vhosts/ '/mnt/win_c-drv/Program Files (x86)/Ampps/www/vhosts/'+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-avz</font> <font color="#A347BA">--delete</font> /var/www/vhosts/ <font color="#A2734C">&apos;/mnt/win_c-drv/Program Files </font><font color="#12488B"><b>(</b></font><font color="#A2734C">x86</font><font color="#12488B"><b>)</b></font><font color="#A2734C">/Ampps/www/vhosts/&apos;</font>
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
行 196: 行 193:
 <WRAP color_term> <WRAP color_term>
 <WRAP color_command><html><pre> <WRAP color_command><html><pre>
-<b class=GRN>$</b> <b class=HIY>rsync</b> <b class=HIK>-rlptvz --delete</b> /var/www/vhosts/ '/mnt/win_c-drv/Program Files (x86)/Ampps/www/vhosts/'+<font color="#FF8700"><b>$</b></font> <font color="#26A269">rsync</font> <font color="#A347BA">-rlptvz</font> <font color="#A347BA">--delete</font> /var/www/vhosts/ <font color="#A2734C">&apos;/mnt/win_c-drv/Program Files </font><font color="#12488B"><b>(</b></font><font color="#A2734C">x86</font><font color="#12488B"><b>)</b></font><font color="#A2734C">/Ampps/www/vhosts/&apos;</font>
 </pre></html></WRAP> </pre></html></WRAP>
 <WRAP color_result><html><pre> <WRAP color_result><html><pre>
  • linux/rsync.1710385562.txt.gz
  • 最終更新: 2024/03/14 12:06
  • by ともやん