no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | linux:misc:cron:diskspace_zulip_notify [2020/06/01 10:35] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Send Zulip notification on low disk space in Linux ====== | ||
+ | <code bash> | ||
+ | #/bin/bash | ||
+ | free_percent=$(df -h | grep /data | awk ' | ||
+ | free_percent_no=$(df -h | grep /data | awk ' | ||
+ | free_no=$(df -h | grep /data | awk ' | ||
+ | FILE=/ | ||
+ | if [ " | ||
+ | if [[ ! -f " | ||
+ | curl -X POST https:// | ||
+ | -u name-bot@chat.example.com.hr:< | ||
+ | -d " | ||
+ | -d " | ||
+ | -d " | ||
+ | -d $" | ||
+ | touch $FILE | ||
+ | datum=$( date +%F ) | ||
+ | echo " | ||
+ | else | ||
+ | datum=$( date +%F ) | ||
+ | datumf=`cat $FILE` | ||
+ | if [ " | ||
+ | echo " | ||
+ | curl -X POST https:// | ||
+ | -u name-bot@chat.example.com.hr:< | ||
+ | -d " | ||
+ | -d " | ||
+ | -d " | ||
+ | -d $" | ||
+ | fi | ||
+ | fi | ||
+ | else | ||
+ | if [[ -f " | ||
+ | rm $FILE | ||
+ | fi | ||
+ | fi | ||
+ | </ |