]> git.sur5r.net Git - bacula/bacula/blob - bacula/scripts/freespace
Remove two incorrect trailing commas in bsock.h
[bacula/bacula] / bacula / scripts / freespace
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # Bacula interface to get device freespace
7 #
8 #  If you set in your Device resource
9 #
10 #  Free Space Command = "path-to-this-script/freespace %a"
11 #    you will have the following input to this script:
12 #
13 #
14 #  freespace "archive-device"
15 #                  $1
16 #
17
18 OS=`uname`
19 case ${OS} in
20   SunOS)
21     cmd="/bin/df -P"
22     ;;
23   FreeBSD)
24     cmd="/bin/df -P"
25     ;;
26   Linux)
27     cmd="/bin/df -P"
28   ;;
29   *)
30     cmd="/bin/df -P"
31   ;;
32 esac
33
34 $cmd $1 | tail -1 | awk '{ print $4 }'