mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-12-26 12:05:09 +01:00
Solved free disc space bugs
This commit is contained in:
parent
de5d5e4ce4
commit
26ef7e00f0
@ -1,13 +1,13 @@
|
||||
- name: "create {{free_disc_space_folder}"
|
||||
- name: "create {{free_disc_space_folder}}"
|
||||
file:
|
||||
path: "{{free_disc_space_folder}"
|
||||
path: "{{free_disc_space_folder}}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: create free-disc-space.sh
|
||||
template:
|
||||
src: free-disc-space.sh.j2
|
||||
dest: "{{free_disc_space_folder}free-disc-space.sh"
|
||||
dest: "{{free_disc_space_folder}}free-disc-space.sh"
|
||||
|
||||
- name: create free-disc-space.service
|
||||
template:
|
||||
@ -19,4 +19,4 @@
|
||||
template:
|
||||
src: free-disc-space.timer.j2
|
||||
dest: /etc/systemd/system/free-disc-space.timer
|
||||
notify: restart free-disc-space.timer
|
||||
notify: restart free-disc-space.timer
|
@ -4,4 +4,4 @@ OnFailure=systemd-email@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash {{free_disc_space_folder}}free-disc-space.sh {{size_percent_free_disc_space}}
|
||||
ExecStart=/bin/bash {{free_disc_space_folder}}free-disc-space.sh {{size_percent_free_disc_space}}
|
@ -34,6 +34,7 @@ if [ "$disc_use_percent_number" -gt "$minimum_percent_free_disc_space" ] || [ "$
|
||||
|
||||
nextcloud_application_container="nextcloud-application-1"
|
||||
if [ "$(docker ps -a -q -f name=$nextcloud_application_container)" ] ; then
|
||||
echo "cleaning up docker nextcloud" &&
|
||||
docker exec -it -u www-data $nextcloud_application_container /var/www/html/occ files:cleanup || exit 4
|
||||
docker exec -it -u www-data $nextcloud_application_container /var/www/html/occ trashbin:cleanup --all-users || exit 5
|
||||
docker exec -it -u www-data $nextcloud_application_container /var/www/html/occ versions:cleanup || exit 6
|
||||
@ -45,7 +46,7 @@ if [ "$disc_use_percent_number" -gt "$minimum_percent_free_disc_space" ] || [ "$
|
||||
yes | pacman -Sc || exit 7
|
||||
|
||||
echo "cleanup finished."
|
||||
elif
|
||||
else
|
||||
echo "Sufficiend disc space available."
|
||||
echo "To force the freeing of disc space pass the parameter --force."
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user