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