Linux disk space alerts on Discord

Linux disk space alerts on Discord

Linux disk space alerts. Check your space and be responsible with your project. Take care of your space and don’t crack the project.

This is a very simple and handy tutorial about how to check the disk space every day and send the alert using Discord.


  • discord webhook

Create the script

Create new file


# This variable holds the usage disk space in percents
CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')

# The threshold where the alert will be sent. By default is 90, so when your server disk usage cross this border, the alerts will come on your discord.

# The url of the webhook. You can copy this value from Discord.
DISCORD_WEBHOOK_URL=<Your webhook url here without tags>

# The name of the project. You can put whatever you want here.
PROJECT_NAME="<project name without tags>"
# The url of the project.
PROJECT_URL=<project url without tags>

if [ "$CURRENT" -gt "$THRESHOLD" ] ; then

curl --location --request POST "$DISCORD_WEBHOOK_URL" \
--form "content=\":floppy_disk: The disk space for $PROJECT_NAME - $PROJECT_URL is critical.
Used: $CURRENT%. 
Please clean up some space.\" " \
--form 'username="Disk Space Alert"'


Make the script executable

Be sure that you have permissions to at least 755 set.

sudo chmod +x /home/ubuntu/

!!! Use your full path the the file

Automate the script

crontab -e

and at the end of the file enter

0 6 * * * /bin/bash /home/ubuntu/

!!! Use your full path the the file


Related Posts

Tools for Analyzing Your Competition

Before knowing where your business stands, you should look at the market and your competition. You need to know what marketing tactics and strategies are working for your audience, what traffic the competition has, and how they position.

Free Online Photo Editor with Cool Effects | Edit Images Easily

Transform your images with our free online photo editor with cool effects. Add filters, adjust colors, and apply creative enhancements. Edit your photos easily and make them stand out.

How to find the size of a table in SQL?

Learn how to determine the size of a SQL table with this informative guide. Discover efficient methods for measuring table size.

MongoDB Query date by _id field

Query date by _id in mongodb. Straighforward guide to solve your issue right away.

Unleashing the Power of Free API for Scrape Reverse Geocoding

Learn how to harness the potential of reverse geocoding with our beginner's guide to scraping APIs for free. Unlock the power today.

Discover the Power of Whatsapp-web.js for Safe and Easy Automation

Automate WhatsApp with ease using Whatsapp-web.js, a NodeJS client library that connects through the official WhatsApp Web app, reducing ban risks. Perfect for user or business accounts.

Website tours js tools

Tools to create live tours for your web project using js libraries.

Unlocking SaaS Marketing Success: Essential Resources to Learn and Grow

Discover a comprehensive collection of valuable resources to master the art of SaaS marketing.

Where to launch your startup

Do you wanna launch grandiosely your startup? Get a list of platforms where people can discover your project and can push your project directly to the sky.

Email campaign improving my SaaS convertion - Manager Flota

Users subscribe to your SaaS, but don't let the money on your table. Here's how I do it!