File: dar_rqck.bash

package info (click to toggle)
dar 2.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,068 kB
  • sloc: cpp: 86,310; sh: 6,996; ansic: 895; makefile: 502; python: 242; csh: 115; perl: 43; sed: 16
file content (25 lines) | stat: -rw-r--r-- 591 bytes parent folder | download | duplicates (12)
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
#!/bin/bash

MT=$(sed '/^MemTotal/!d;s/.*  //' /proc/meminfo)
echo -e "\n\tyou have $MT total memory"

ST=$(sed '/^SwapTotal/!d;s/.*  //' /proc/meminfo)
echo -e "\n\tyou have $ST total swap"

P=$(mount | sed '/^none/d' | awk '{print $3}')

for p in $P
do
	fc=$(find $p -xdev \
		-path '/tmp' -prune -o \
		-path '/var/tmp' -prune -o \
		-print |
		wc -l)
	echo -e "\n\tpartition \"$p\" contains $fc files"
	(( iioh = ($fc * 1300)/1024 ))
	echo -e "\tdar differential backup with infinint requires $iioh kB memory"
done

echo

# /proc and /sys (and /dev if it's udev) are excluded by "-xdev"