summaryrefslogtreecommitdiffstats
path: root/tools/check_diskspace
diff options
context:
space:
mode:
authorOle Kristian Lien <ole.k.lien@gmail.com>2009-12-04 10:53:53 +0000
committerOle Kristian Lien <ole.k.lien@gmail.com>2009-12-04 10:53:53 +0000
commitd81dc41d4d817f2d5fb3e721449d27bf0832634a (patch)
tree915d6c3b956a04e47a88fd4ea2983cd645f8a8c3 /tools/check_diskspace
parent0118f00cfc3d3f46fce44584fc0b2079c27db360 (diff)
added some more tools
Diffstat (limited to 'tools/check_diskspace')
-rw-r--r--tools/check_diskspace20
1 files changed, 20 insertions, 0 deletions
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 <file>"
+ exit 1
+fi
+
+if [ $DISK -le $FILE ]; then
+ echo "Error: Not enough disk space to continue! Aborting."
+ exit 1
+fi