ユーザ用ツール

差分

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

この比較画面へのリンク

バックアップ [2017/04/27 21:11] – 外部編集 127.0.0.1バックアップ [2021/05/30 19:34] (現在) – [ディレクトリのローテーション] araki
行 163: 行 163:
 while [ ${n} -gt 0 ]; do while [ ${n} -gt 0 ]; do
     m=`expr ${n} - 1`     m=`expr ${n} - 1`
-    if [ -d "${DIR}${m}" ]; then+    if [ -d "${DIR}${m}" -a ! -d "${DIR}${n}" ]; then
         mv "${DIR}${m}" "${DIR}${n}"         mv "${DIR}${m}" "${DIR}${n}"
     fi     fi
行 172: 行 172:
  
 こんな感じのスクリプトを作成し保存、実行可能としたら、rotatedir.pub の方の commandを こんな感じのスクリプトを作成し保存、実行可能としたら、rotatedir.pub の方の commandを
-command = "/root/bin/rotatelog.sh" に変更する。+command = "/root/bin/rotatedir.sh" に変更する。
  
 ==== rsyncのコマンドライン  ==== ==== rsyncのコマンドライン  ====

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information