mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-25 22:21:04 +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:
|
file:
|
||||||
path: "{{free_disc_space_folder}"
|
path: "{{free_disc_space_folder}}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: create free-disc-space.sh
|
- name: create free-disc-space.sh
|
||||||
template:
|
template:
|
||||||
src: free-disc-space.sh.j2
|
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
|
- name: create free-disc-space.service
|
||||||
template:
|
template:
|
||||||
@ -19,4 +19,4 @@
|
|||||||
template:
|
template:
|
||||||
src: free-disc-space.timer.j2
|
src: free-disc-space.timer.j2
|
||||||
dest: /etc/systemd/system/free-disc-space.timer
|
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]
|
[Service]
|
||||||
Type=oneshot
|
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"
|
nextcloud_application_container="nextcloud-application-1"
|
||||||
if [ "$(docker ps -a -q -f name=$nextcloud_application_container)" ] ; then
|
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 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 trashbin:cleanup --all-users || exit 5
|
||||||
docker exec -it -u www-data $nextcloud_application_container /var/www/html/occ versions:cleanup || exit 6
|
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
|
yes | pacman -Sc || exit 7
|
||||||
|
|
||||||
echo "cleanup finished."
|
echo "cleanup finished."
|
||||||
elif
|
else
|
||||||
echo "Sufficiend disc space available."
|
echo "Sufficiend disc space available."
|
||||||
echo "To force the freeing of disc space pass the parameter --force."
|
echo "To force the freeing of disc space pass the parameter --force."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user