Ajouter miscellaneous/clean_free_space.sh
This commit is contained in:
15
miscellaneous/clean_free_space.sh
Normal file
15
miscellaneous/clean_free_space.sh
Normal 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
|
||||
Reference in New Issue
Block a user