Last active
January 20, 2021 15:52
-
-
Save hernan43/4d48a343dcc3fa5f807dd313066698aa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#Delete danging docker images | |
docker rmi $(docker images --quiet --filter "dangling=true") | |
echo "$(date "+%m-%d-%Y %T") : Cleaned up dangling docker images" >> $LOGFILE 2>&1 | |
#Delete DS Store file types after 7 days, uses a dstore.txt to keep track on every run. | |
read dsStoreRun < /tmp/dstore.txt | |
if ((dsStoreRun == 7)); then | |
find /mnt/user -maxdepth 9999 -noleaf -type f -name ".DS_Store" -exec rm "{}" \; | |
echo "$(date "+%m-%d-%Y %T") : Deleted .DS_Store Files" >> $LOGFILE 2>&1 | |
dsStoreRun=0 | |
else | |
dsStoreRun=$((dsStoreRun + 1)) | |
fi | |
echo $dsStoreRun > /tmp/dstore.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment