Skip to content

Commit

Permalink
Merge pull request #491 from berkmancenter/hotfix_cache_clear_again
Browse files Browse the repository at this point in the history
Suppress irritating find errors
  • Loading branch information
thatandromeda authored Sep 28, 2018
2 parents 35d6a46 + 16df866 commit 49fbf03
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/tasks/lumen.rake
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,14 @@ where works.id in (
task safer_cache_clear: :environment do
# Go to cache dir;
# clear out any files more than 20 minutes old;
# remove empty directories.
# remove empty directories;
# dump stderr to logfiles so it stops emailing us.
# (Everything in log/ should get autorotated on prod based on its logrotate
# configuration.)
cmd = "cd #{__dir__}/../../tmp/cache && " \
'find . -type f -amin +20 -delete && ' \
'find . -type d -empty -delete'
"touch #{__dir__}/../../log/safer_cache_clear.log &&" \
"find . -type f -amin +20 -delete 2>> #{__dir__}/../../log/safer_cache_clear.log && " \
"find . -type d -empty -delete 2>> #{__dir__}/../../log/safer_cache_clear.log"
system(cmd)
end
end

0 comments on commit 49fbf03

Please sign in to comment.