Files
scripts-admin-debian/miscellaneous/clean_free_space.sh
2024-12-30 19:32:53 +00:00

15 lines
438 B
Bash

#!/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