find -mtime ã使ã
# æçµæ´æ°ãã 24 æé以ä¸çµéãã¦ããã if [[ "$(find /path/to/file -mtime +0)" != "" ]]; then echo 'OLD!' else echo 'NEW!' fi
-mtime +0
ããªãã24æé以ä¸åãã«ãªãã®ãï¼ã«ã¤ãã¦:
-mtime n ãããã¡ã¤ã«ã®æçµå 容æ´æ°æ¥æããåºç¹ã¨ãªãæå»ããè¨ç®ã㦠n æ¥åã«å½ããã°ãçãè¿ã (訳注: åºç¹ã¨ãªãæå»ã¯ãããã©ã«ãã§ã¯ find ãå®è¡ãã¦ããä»ç¾å¨ã§ãã)ã ãã(snip) ãããªããããã©ã«ãã®åä½ã®ããã«ãç¾å¨æå»ããæ°ã㦠24 æéåãã 48 æéåã¾ã§ã 1 æ¥åã¨ãã
ã¤ã¾ãã
- 1æ¥å = 24æéåãã48æéå
ãªã®ã§ã
- næ¥å = n*24æéåãã(n+1)*24æéå
ã¤ã¾ãã
-mtime 0 = æçµæ´æ°ã0æ¥å = 0æéåãã24æéå -mtime 1 = æçµæ´æ°ã1æ¥å = 24æéåãã48æéå -mtime 2 = æçµæ´æ°ã2æ¥å = 48æéåãã72æéå
次㫠n ã®è¨æ³ã«ã¤ãã¦ã
æ°å¤ã®å¼ãæ°ã¯ã以ä¸ã®å½¢ã§æå®ãããã¨ãã§ããã +n ããn ãã大ããã -n ããn ããå°ããã n ããã¡ããã© nã
ãªã®ã§ã
-mtime +0
- =
-mtime 1
ã¾ãã¯-mtime 2
ã¾ãã¯...
- = æçµæ´æ°ã0æ¥åããéå»
- = 24æéåããéå»
ã¨ãªãã