Create packager cronjob for clearing uploaded files

This commit is contained in:
Oliver Günther
2016-12-12 08:55:37 +01:00
parent 4372bccdf6
commit 2f138002af
3 changed files with 4 additions and 1 deletions
+1
View File
@@ -39,6 +39,7 @@ targets:
before_precompile: "packaging/setup"
crons:
- packaging/cron/openproject-clear-old-sessions
- packaging/cron/openproject-clear-uploaded-files
services:
- postgres
installer: https://github.com/pkgr/installer.git
-1
View File
@@ -33,7 +33,6 @@ namespace :attachments do
CarrierWave.clean_cached_files!
end
desc 'Copies all attachments from the current to the given storage.'
task :copy_to, [:to] => :environment do |_task, args|
if args.empty?
@@ -0,0 +1,3 @@
APP_NAME="_APP_NAME_"
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
0 23 * * 5 root ${APP_NAME} run rake -s attachments:clear >> /var/log/${APP_NAME}/cron-clear-uploaded-files.log 2>&1