Skip to content

Instantly share code, notes, and snippets.

@geunho
Created August 19, 2019 01:34
Show Gist options
  • Save geunho/7c03ec8233fb56e342c67ee660912ee6 to your computer and use it in GitHub Desktop.
Save geunho/7c03ec8233fb56e342c67ee660912ee6 to your computer and use it in GitHub Desktop.
# remove_old_files.sh /path/of/root 90
#
# 오래된 파일을 삭제한다.
##########################################
$root_path=$1
$days_past=$2
find $root_path -type d -ctime +$days_past | xargs rm -rf
@geunho
Copy link
Author

geunho commented Oct 14, 2021

# 파일인 경우 find 옵션을 f 로 설정
find $root_path -type f -ctime +$days_past | xargs rm -rf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment