Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
クリーンアップ スクリプト:
. $HOME/u0146121 find $HOME/OldLogFiles/ -type f -mtime +7 -delete
7 日以上前のファイルを削除しましたが、削除したファイルをログに記録したいと思います。配管を使用する必要がありますか? シェルスクリプト初心者です。
テストされていない
log=$HOME/OldLogFiles/deleted.log.$(date +%Y%m%d%H%M%S) find $HOME/OldLogFiles/ -type f -mtime +7 -delete -print > "$log"