From 8a930e7cf5ee439e008948609c5bdde8b3141508 Mon Sep 17 00:00:00 2001 From: Manuel Kamper Date: Thu, 28 Dec 2023 17:41:32 +0000 Subject: [PATCH] Readme.md aktualisiert --- Readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Readme.md b/Readme.md index a706bb0..719ff2f 100644 --- a/Readme.md +++ b/Readme.md @@ -2,20 +2,20 @@ ## Disclaimer -This was generated by AI, running a selfhosted LocalAI. So please doublecheck before you use it. +This Instruction was generated by AI, running a selfhosted LocalAI. So please doublecheck before you use it. ## Instructions -To receive notifications when your disk space on your Ubuntu server is running low, you can use the df command to monitor disk usage and set up alerts using the mail command. Here’s how you can do it: +To receive notifications when your disk space on your Ubuntu server is running low, you can use the df command to monitor disk usage and set up alerts using the mail command. Here's how you can do it: -Install the mailutils package if it’s not already installed on your server: +Install the mailutils package if it's not already installed on your server: -´´´sudo apt-get install mailutils´´´ +`sudo apt-get install mailutils` Create a script to send an email notification when disk space is low: -´´´ +` #!/bin/bash # Set your email address here @@ -32,19 +32,19 @@ df -h / | awk '$NF > "{{threshold}}%" {print $1}' | while read disk; do echo "Disk $disk is full!" | mail -s "Disk Full Alert" "$email" fi done -´´´ +` Save the script as disk_full_alert.sh and make it executable: -´´´chmod +x disk_full_alert.sh´´´ +`chmod +x disk_full_alert.sh` Set up a cron job to run the script daily: -´´´sudo crontab -e´´´ +`sudo crontab -e` Add the following line to the crontab file: -´´´0 0 * * * /path/to/disk_full_alert.sh´´´ +`0 0 * * * /path/to/disk_full_alert.sh` This will run the script at midnight every day. Now, you should receive an email notification when the disk space on your server is running low. You can adjust the threshold variable in the script to set the disk usage percentage at which you want to receive notifications. \ No newline at end of file