USB HDDéã§å¤§å®¹éã®ãã¡ã¤ã«ã³ãã¼ãè¡ãå¿ è¦ãåºã¦ããã®ã§ã調ã¹ã¦ã¿ãã
rsyncã§ãã¡ã¤ã«ã³ãã¼ãè¡ãã«ã¯ã次ã®ããã«ããã°ããã
ã³ãã¼å
ã®ãã¹ã«ã¤ãã¦ãæå¾ã«ã¹ã©ãã·ã¥ãã¤ããªãå ´åã¯ãã£ã¬ã¯ããªãã¨ãã¤ããå ´åã¯ãã£ã¬ã¯ããªã®ä¸èº«ãã¨ã®ã³ãã¼ã¨ãªãã
ã¾ããSSHçµç±ã§ãªã¢ã¼ããµã¼ãã«ã¢ã¯ã»ã¹ããå ´åã¯ãuser@server:/path/to/src
ã®ããã«æå®ããã
$ rsync -avhP /path/to/src /path/to/dst
ãªãã·ã§ã³ã®æå³ã¯ä¸è¨ã®éãã
$ rsync --version rsync version 3.0.9 protocol version 30 $ man rsync -v, --verbose increase verbosity -a, --archive archive mode; equals -rlptgoD (no -H,-A,-X) -h, --human-readable output numbers in a human-readable format --partial keep partially transferred files --progress show progress during transfer -P same as --partial --progress
-a
ã¯å帰çã³ãã¼ã¨ãã¼ããã·ã§ã³ã®ä¿åãè¡ãã-v
ã¯è©³ç´°ãªåºåãåãã-h
ã¯ãã¤ãæ°ãMBãGB表示ã«ããã-P
ã¯é²æã®è¡¨ç¤ºã¨ãä¸æãããéã«æªå®äºãã¡ã¤ã«ãæ®ããã¾ãã-W
ãªãã·ã§ã³ã§å·®å転éã¢ã«ã´ãªãºã ããªãã«ã§ããããã³ãã¼å
ã»ã³ãã¼å
ããã¼ã«ã«ã®å ´åã¯ããã©ã«ãã§ãªãã«ãªã£ã¦ããã
--progress
ãªãã·ã§ã³ã§ã¯ã次ã®ããã«é²æã表示ãããã
1238099 100% 146.38kB/s 0:00:08 (xfer#5, to-check=169/396)
æ¬å¼§å ã®åºåããããã®æç¹ã§5çªç®ã®è»¢éãçµãããåè¨396ãã¡ã¤ã«ã®ãã¡169ãã¡ã¤ã«ã®å¦çãæ®ã£ã¦ãããã¨ããããï¼ã¤ã¾ãã396-169-5åã®ãã¡ã¤ã«ã¯å·®åããªãã£ãããã¹ãããããã¦ããï¼ã
ã³ãã¼ãéä¸ã§ä¸æããå ´åããä¸ã®ã³ãã³ããç¹°ãè¿ãå®è¡ãããã¨ã§ç¶ãããåéã§ããã
ãªãã--delete
ãªãã·ã§ã³ãä»ãããã¨ã§ã転éå
ã«åå¨ããªããã¡ã¤ã«ã転éå
ããåé¤ã-z
ãªãã·ã§ã³ãä»ãããã¨ã§å§ç¸®ãã¦è»¢éãè¡ããã¨ãã§ããã