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:
This will run the script at 0 minutes past every 4 hours every day.
Now, the script will run every 4 hours, checking disk usage and sending an email notification if the disk space is running low. You can adjust the interval as needed to suit your schedule.
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.