-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchanges.sh
More file actions
executable file
·39 lines (34 loc) · 765 Bytes
/
changes.sh
File metadata and controls
executable file
·39 lines (34 loc) · 765 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
31
32
33
34
35
36
37
38
39
#!/bin/bash
DIRS=$(find /data/Media/ -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*' && find /data/ -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*' -not -path '/data/Media')
fileInfo () {
local CHANGE=$(find $DIR -not -path '*/\.*' -type f -mtime -7 | wc -l)
echo "<tr>"
echo "<td>$DIR</td>"
echo "<td>$CHANGE</td>"
echo "</tr>"
return 0
}
for DIR in $DIRS
do
san=$(echo $DIR | sed 's/[^a-zA-Z0-9]//g')
fileInfo > /tmp/$san &
done
wait
echo "<section id='files'>"
echo "<table>"
echo "<thead>"
echo "<tr>"
echo "<th>Directory</td>"
echo "<th>Changes (7 days)</th>"
echo "</tr>"
echo "</thead>"
echo "<tbody>"
for DIR in $DIRS
do
san=$(echo $DIR | sed 's/[^a-zA-Z0-9]//g')
cat /tmp/$san
rm /tmp/$san
done
echo "</tbody>"
echo "</table>"
echo "</section>"