Created
June 23, 2015 13:46
-
-
Save hnnesv/9de4bee4d1e4611964e4 to your computer and use it in GitHub Desktop.
evaporate
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 | |
# Remove any files or folders that have a 'transient' tag and haven't been accessed in a while | |
echo "[`date`] Evaporate task triggered"; | |
for i in `mdfind -onlyin ~ 'tag:transient'`; do | |
if test "`find $i -atime +5`"; then | |
rm -fR $i; | |
echo "[`date`] Removed $i"; | |
fi | |
done |
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
<?xml version="1.0"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>localhost.evaporate</string> | |
<key>Program</key> | |
<string>/Users/hannes/bin/evaporate</string> | |
<key>StartInterval</key> | |
<integer>20000</integer> | |
<key>StandardErrorPath</key> | |
<string>/var/log/evaporate.log</string> | |
<key>StandardOutPath</key> | |
<string>/var/log/evaporate.log</string> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment