scripts 1
Bash Script (memorycheck.sh)
#!/bin/bash
# Fetch disk usage percentage for the current directory
space=$(df -h . | tail -1 | awk '{print $(NF-1)}' | tr -d '%')
echo "Consumed disk space is ${space}%"
# Check if disk usage is greater than or equal to 90%
if [ "$space" -ge 90 ]; then
echo "Disk space is more than 90%. Please take appropriate action." \
| mail -s "Alert: Disk Space Exceeded 90%" -c "[email protected]" "[email protected]"
fiNotes
✅ Cron Job Setup
📘 Cron Syntax Breakdown
📌 Cron Examples
Cron Expression
Description
