-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobsolete_files.sh
More file actions
executable file
·31 lines (30 loc) · 959 Bytes
/
obsolete_files.sh
File metadata and controls
executable file
·31 lines (30 loc) · 959 Bytes
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
#!/bin/sh
if [ $# -eq 0 ]; then
echo FreeBSD upgrade obsolete file check.
echo 1. Create mtree file: obsolete_files.sh base_root_path
echo 2. Run the check: obsolete_files.sh base.mtree_file base_root_path
elif [ $# -eq 1 ]; then
mtree -c -k nochange -p $1 > mtree.out
elif [ $# -eq 2 ]; then
RELEASE=`uname -r`
mtree -f $1 -p $2 | grep extra \
| grep -v "^boot/firmware" \
| grep -v "^boot/kernel" \
| grep -v "^boot/modules" \
| grep -v "^boot/zfs" \
| grep -v "^dev" \
| grep -v "^etc/X11" \
| grep -v "^home" \
| grep -v "^media" \
| grep -v "^mnt" \
| grep -v "^proc" \
| grep -v "^tmp" \
| grep -v "^usr/compat" \
| grep -v "^usr/games" \
| grep -v "^usr/home" \
| grep -v "^usr/local" \
| grep -v "^usr/ports" \
| grep -v "^usr/obj" \
| grep -v "^usr/obj" \
| grep -v "^var"
fi;