Skip to content

Instantly share code, notes, and snippets.

@fy-kenny
fy-kenny / VolumeUsage.java
Created April 26, 2018 02:18
Display usage of all volumes or the specified one
package com.arcvideo.berd.face.utils;
/*
* Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@fy-kenny
fy-kenny / gist:09deb8f13d83ded8fc5e2f05ee925ba1
Created April 26, 2018 01:30 — forked from fduran/gist:1870429
Linux disk space email alert
#!/bin/bash
# www.fduran.com
# script that will send an email to EMAIL when disk use in partition PART is bigger than %MAX
# adapt these 3 parameters to your case
MAX=95
[email protected]
PART=sda1
USE=`df -h |grep $PART | awk '{ print $5 }' | cut -d'%' -f1`
if [ $USE -gt $MAX ]; then