From d81dc41d4d817f2d5fb3e721449d27bf0832634a Mon Sep 17 00:00:00 2001 From: Ole Kristian Lien Date: Fri, 4 Dec 2009 10:53:53 +0000 Subject: added some more tools --- tools/check_diskspace | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tools/check_diskspace (limited to 'tools/check_diskspace') diff --git a/tools/check_diskspace b/tools/check_diskspace new file mode 100644 index 0000000..7b7031c --- /dev/null +++ b/tools/check_diskspace @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Date: 2009-12-04 +# Author: Ole Kristian Lien +# License: GNU General Public License +# +# Check for free space needed to work with video-file + +DISK=`df \`pwd\` | tail -1 | awk '{print $4}'` +FILE=`du $1 | awk '{print $1}'` + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +if [ $DISK -le $FILE ]; then + echo "Error: Not enough disk space to continue! Aborting." + exit 1 +fi -- cgit v1.2.3