-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create cronjob to clean up disk space periodically
A new cronjob has been created that looks for unused build artifacts and deletes them. The job runs every day at midnight.
- Loading branch information
Showing
5 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: Copy cleanup script | ||
template: | ||
src: clean-unused-checkouts.sh | ||
dest: /etc/cron.cleanup_disk_space | ||
owner: root | ||
group: root | ||
mode: 0744 | ||
|
||
- name: Set up the cleanup cron job | ||
template: | ||
src: cron_cleanup_disk_space.j2 | ||
dest: /etc/cron.d/cleanup_disk_space | ||
# if the cron job is running right now, keep retrying until it finishes | ||
register: cleanup_cron_result | ||
until: cleanup_cron_result is not failed | ||
retries: 10 | ||
delay: 5 |
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
4 changes: 4 additions & 0 deletions
4
...v-desktop/files/clean-unused-checkouts.sh → ...sktop/templates/clean-unused-checkouts.sh
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
2 changes: 2 additions & 0 deletions
2
ansible/roles/dev-desktop/templates/cron_cleanup_disk_space.j2
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
0 0 * * * root /etc/cron.cleanup_disk_space |
File renamed without changes.