Ajouter miscellaneous/clean_free_space.sh

This commit is contained in:
Philippe Favre
2024-12-30 19:32:53 +00:00
parent 763fe5070f
commit 8007388d0f

View File

@@ -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