Created
January 5, 2022 06:05
-
-
Save zaheeraws/465ef64b81083f6bf2657185eb0bb95c to your computer and use it in GitHub Desktop.
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 | |
declare -a DIRS=("tmp" "video_clips" "video_thumbnails", "pdfs", "extracts", "coverage") | |
DAYS_TO_KEEP=3 | |
BASE_PATH="/home/aviary/current" | |
BASE_PATH="/Users/mac/Documents/projects/aviary" | |
DIRS_LIST=${#DIRS[@]} | |
for (( i=0; i<${DIRS_LIST}; i++ )); | |
do | |
echo "${i} Removing Files under: ${BASE_PATH}/${DIRS[$i]}" | |
"find ${BASE_PATH}/${DIRS[$i]}/* -mtime +${DAYS_TO_KEEP} -exec rm {} \;" | |
wait | |
done | |
currentDate=`date` | |
echo "DONE @ $currentDate" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment