Looking shell script for df command

34 views
Skip to first unread message

Pinakin Bhatt

unread,
May 20, 2020, 7:17:24 AM5/20/20
to VG...@googlegroups.com
Hi

I am looking shell script to check df command, if df -h command getting hang due to nfs issue then send email.

Regards,
Pinakin

Nirmal

unread,
May 20, 2020, 8:42:32 AM5/20/20
to VGLUG


On Wednesday, 20 May 2020 16:47:24 UTC+5:30, Pinakin Bhatt wrote:
Hi

I am looking shell script to check df command, if df -h command getting hang due to nfs issue then send email.

You can try using 'timeout' command to build your script. [1]

$ timeout 5 df -h

You can play around the exit status of it & trigger a mail using 'mail' command. You can use 'if' statement or 'while' statement to build your script.

 
Regards,
Pinakin

Pinakin Bhatt

unread,
May 20, 2020, 10:11:35 AM5/20/20
to VG...@googlegroups.com
Hi..

Thanks a lots.

"timeout" option work for me.

Regards,
Pinakin

--
Please read http://www.catb.org/~esr/faqs/smart-questions.html before posting.
You received this message because you are subscribed to the "Vibrant GNU/Linux User Group".
To stop receiving emails from this group, mail to VGLUG+un...@googlegroups.com
To post to this group, send email to VG...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/VGLUG

---
You received this message because you are subscribed to the Google Groups "VGLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vglug+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vglug/89ccc5a2-701f-41c3-8a05-76f3f50e5bc6%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages