0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

rsync の -a オプションの意味を整理する

Last updated at Posted at 2021-08-16

経緯

  • 取り急ぎ、rsync コマンドを使うとき、-a オプションを付けて実行することがあるが、
  • Windows10 Git Bash 環境において rsync を実行するときに、-a オプションを使ってよいか心配になった
  • -a オプションの意味を正確に把握していいないので、整理する

環境

Windows 10

  • Git Bash
  • rsync version 3.2.2 protocol version 31

WSL

  • Ubuntu 20.04
  • rsync version 3.1.3 protocol version 31

rsync -a オプションの意味

  • -rlptgoD と同じとのこと
  • Window 10 Git Bash では、groupowner などの扱いは不明
  • 今のところ、Windows 10 Git Bash で、-a オプションを使っても、問題がなさそうに感じる
 -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
 -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
     --devices               preserve device files (super-user only)
 -H, --hard-links            preserve hard links
 -A, --acls                  preserve ACLs (implies --perms)
 -X, --xattrs                preserve extended attributes
オプション 長い形式のオプション 意味
-a --archive -rlptgoD と同じ
-r --recursive 再帰的に実施
-l --links シンボリックリンクをコピー
-p --perms パーミッション情報を保持
-t --times 時刻情報を保持
-g --group グループ情報を保持
-o --owner オーナー情報を保持
-D --devices デバイスファイルを保持
-H --hard-links hard linksを保持
-A --acls ACLs を保持
-X --xattrs extended attributesを保持

参考にした情報

Help

rsync --help

Git Bash に rsync をインストールする方法

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?