From 8007388d0f7cdd3176e8f827ee9910d56aafe651 Mon Sep 17 00:00:00 2001 From: Philippe Favre Date: Mon, 30 Dec 2024 19:32:53 +0000 Subject: [PATCH] Ajouter miscellaneous/clean_free_space.sh --- miscellaneous/clean_free_space.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 miscellaneous/clean_free_space.sh diff --git a/miscellaneous/clean_free_space.sh b/miscellaneous/clean_free_space.sh new file mode 100644 index 0000000..5d316c4 --- /dev/null +++ b/miscellaneous/clean_free_space.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# This script is used to free up unused disk space by temporarily filling free space with zeros. +# It can be scheduled to run automatically using cron. + +# Change the working directory to /root +cd /root + +# Create a file filled with zeros to occupy the remaining free space +dd if=/dev/zero | pv | dd of=grosfichier + +# Wait for 5 seconds before continuing +sleep 5 + +# Delete the temporary file to free up disk space +rm grosfichier \ No newline at end of file