This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Meant to be run nightly by a cron job on this box. This script will: | |
# - find a list of files that are 1 day old and has no current file handles attached | |
# - log these files into a: deleted.<day_of_the_month>.log file so we have a max log count (no need to clean up) | |
# - delete the files from disk | |
DRY_RUN=${DRY_RUN:-'0'} | |
CLR_TMP_DIR=${CLR_TMP_DIR:-'/tmp'} | |
CLR_TMP_LOG=${CLR_TMP_LOG:-"${HOME}/clr_tmp"} |