-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsysproof
More file actions
executable file
·29 lines (24 loc) · 949 Bytes
/
sysproof
File metadata and controls
executable file
·29 lines (24 loc) · 949 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
#!/bin/bash
#
# This script scans the system and records checksums for system files and directories.
# In order to make
#
DATE=`date +%Y%m%d%H%M`
RECORDSFILEPATH="/tmp"
RECORDSFILENAME="sysproof.log"
RECORDSARCH="$HOME/sysproof-$DATE.tar.gz"
RECORDSFILE="$RECORDSFILEPATH/$RECORDSFILENAME"
# Common system directories
SYSDIR="/bin /boot /etc /lib /lib64 /sbin /usr/bin /usr/include /usr/lib /usr/sbin /usr/share"
# Uncomment the line below to use common system directories + directories used
# to commonly install extra user applications"
#SYSDIR="/bin /boot /etc /lib /lib64 /sbin /usr/bin /usr/include /usr/lib /usr/sbin /usr/share /opt /srv /usr/local"
for i in $SYSDIR; do
test -d $i || break
find $i -type f -exec md5sum {} + &>> $RECORDSFILE
done
md5sum $RECORDSFILE > $RECORDSFILE.md5
cd $RECORDSFILEPATH
tar -cvzf $RECORDSARCH $RECORDSFILENAME $RECORDSFILENAME.md5 &>/dev/null && \
rm -f $RECORDSFILENAME $RECORDSFILENAME.md5
cd -