File: freespace

package info (click to toggle)
bacula 15.0.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,780 kB
  • sloc: ansic: 194,276; cpp: 41,177; sh: 28,258; python: 6,669; makefile: 5,275; perl: 3,666; sql: 1,371; java: 345; xml: 196; awk: 51; sed: 25
file content (34 lines) | stat: -rwxr-xr-x 570 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# Copyright (C) 2000-2020 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#
# Bacula interface to get device freespace
#
#  If you set in your Device resource
#
#  Free Space Command = "path-to-this-script/freespace %a"
#    you will have the following input to this script:
#
#
#  freespace "archive-device"
#                  $1
#

OS=`uname`
case ${OS} in
  SunOS)
    cmd="/bin/df -P"
    ;;
  FreeBSD)
    cmd="/bin/df -P"
    ;;
  Linux)
    cmd="/bin/df -P"
  ;;
  *)
    cmd="/bin/df -P"
  ;;
esac

$cmd $1 | tail -1 | awk '{ print $4 }'