用 rsync 建 public mirror參數筆記

在建專案 mirror 的時候比較長用到的參數,筆記一下…

除了資料的同步以外,很重要的一點是避免使用者在存取的時候剛好在同步資料就爛掉了,一般會用 --archive 加上 --delete-after/--delay-updates,在要資料同步拿完後才一次動作,另外透過 --no-OPTION 拿掉不要處理的部份,例如我會把 owner 跟 group 拿掉,方便 local 要改一些因地制宜的依些設定,再用 --exclude 排除掉 local 的東西,如 .htaccess。

–delete-after receiver deletes after transfer, not during
–delay-updates put all updated files into place at transfer’s end
-S, –sparse handle sparse files efficiently
–safe-links ignore symlinks that point outside the source tree

-v, –verbose increase verbosity
-a, –archive archive mode; equals -rlptgoD (no -H,-A,-X)
–no-OPTION turn off an implied OPTION (e.g. –no-D)

-r, –recursive recurse into directories
-l, –links copy symlinks as symlinks
-p, –perms preserve permissions
-t, –times preserve modification times
-g, –group preserve group
-o, –owner preserve owner (super-user only)
-D same as –devices –specials

-A, –acls preserve ACLs (implies –perms)
-X, –xattrs preserve extended attributes
-H, –hard-links preserve hard links

–exclude=PATTERN exclude files matching PATTERN
–exclude-from=FILE read exclude patterns from FILE

發表迴響