Try using find for cleaning taskotron artifacts/logs

This commit is contained in:
Martin Krizek 2016-05-17 07:57:11 +00:00
parent e51aba3aeb
commit cb749b30ed
3 changed files with 8 additions and 8 deletions

View file

@ -18,8 +18,8 @@
- name: copy tmpwatch cronjob for taskotron artifacts and buildmaster
template: src=taskotron-tmpwatch.cron.j2 dest=/etc/cron.d/taskotron-tmpwatch.cron owner=root group=root mode=0644
when: deployment_type in ['stg', 'prod', 'local']
when: deployment_type in ['prod', 'local']
- name: copy tmpfiles.d for artifacts and buildmaster
template: src=tmpfiles.d.buildmaster.conf.j2 dest=/etc/tmpfiles.d/buildmaster.conf owner=root group=root mode=0644
when: deployment_type in ['dev']
- name: copy cronjob for cleaning old taskotron artifacts and buildmaster logs
template: src=taskotron-clean.cron.j2 dest=/etc/cron.d/taskotron-clean.cron owner=root group=root mode=0644
when: deployment_type in ['dev', 'stg']

View file

@ -0,0 +1,4 @@
0 0 * * * {{ buildmaster_user }} find {{ public_artifacts_dir }} -type d -mtime +120 | xargs -r rm -rf
10 0 * * * {{ buildmaster_user }} find {{ buildmaster_dir }}/x86_64/ -type d -mtime +120 | xargs -r rm -rf
20 0 * * * {{ buildmaster_user }} find {{ buildmaster_dir }}/i386/ -type d -mtime +120 | xargs -r rm -rf
30 0 * * * {{ buildmaster_user }} find {{ buildmaster_dir }}/all/ -type d -mtime +120 | xargs -r rm -rf

View file

@ -1,4 +0,0 @@
d /srv/taskotron/artifacts 0775 buildmaster buildmaster 120d
d /srv/buildmaster/master/x86_64 0700 buildmaster buildmaster 120d
d /srv/buildmaster/master/i386 0700 buildmaster buildmaster 120d
d /srv/buildmaster/master/all 0700 buildmaster buildmaster 120d