diff --git a/Rakefile b/Rakefile index db3c10ef..1f6af625 100644 --- a/Rakefile +++ b/Rakefile @@ -403,3 +403,10 @@ task :renew_ssl_certs => [:environment] do delay += 10 end end + +desc 'purge_tmp_turds' +task :purge_tmp_turds => [:environment] do + ['neocities_screenshot*', 'RackMultipart*', 'neocities_saving_file*', 'newinstall-*', '*.dmp', 'davfile*'].each do |target| + Dir.glob("/tmp/#{target}").select {|filename| File::Stat.new(filename).ctime < (Time.now - 3600)}.each {|filename| FileUtils.rm(filename)} + end +end