1 |
brianr |
1.1 |
diff -Nur smeserver-durep-1.5.0.old/root/etc/e-smith/db/configuration/defaults/durep/folders smeserver-durep-1.5.0/root/etc/e-smith/db/configuration/defaults/durep/folders |
2 |
|
|
--- smeserver-durep-1.5.0.old/root/etc/e-smith/db/configuration/defaults/durep/folders 1969-12-31 19:00:00.000000000 -0500 |
3 |
|
|
+++ smeserver-durep-1.5.0/root/etc/e-smith/db/configuration/defaults/durep/folders 2018-02-10 21:47:42.270000000 -0500 |
4 |
|
|
@@ -0,0 +1 @@ |
5 |
|
|
+ |
6 |
|
|
diff -Nur smeserver-durep-1.5.0.old/root/etc/e-smith/db/configuration/defaults/durep/status smeserver-durep-1.5.0/root/etc/e-smith/db/configuration/defaults/durep/status |
7 |
|
|
--- smeserver-durep-1.5.0.old/root/etc/e-smith/db/configuration/defaults/durep/status 1969-12-31 19:00:00.000000000 -0500 |
8 |
|
|
+++ smeserver-durep-1.5.0/root/etc/e-smith/db/configuration/defaults/durep/status 2018-02-10 21:48:01.906000000 -0500 |
9 |
|
|
@@ -0,0 +1 @@ |
10 |
|
|
+enabled |
11 |
|
|
diff -Nur smeserver-durep-1.5.0.old/root/etc/e-smith/db/configuration/defaults/durep/type smeserver-durep-1.5.0/root/etc/e-smith/db/configuration/defaults/durep/type |
12 |
|
|
--- smeserver-durep-1.5.0.old/root/etc/e-smith/db/configuration/defaults/durep/type 1969-12-31 19:00:00.000000000 -0500 |
13 |
|
|
+++ smeserver-durep-1.5.0/root/etc/e-smith/db/configuration/defaults/durep/type 2018-02-10 21:48:20.017000000 -0500 |
14 |
|
|
@@ -0,0 +1 @@ |
15 |
|
|
+service |
16 |
|
|
diff -Nur smeserver-durep-1.5.0.old/root/usr/sbin/durep.daily smeserver-durep-1.5.0/root/usr/sbin/durep.daily |
17 |
|
|
--- smeserver-durep-1.5.0.old/root/usr/sbin/durep.daily 2014-06-21 06:27:27.000000000 -0400 |
18 |
|
|
+++ smeserver-durep-1.5.0/root/usr/sbin/durep.daily 2018-02-10 22:08:22.838000000 -0500 |
19 |
|
|
@@ -1,5 +1,40 @@ |
20 |
|
|
+#!/bin/bash |
21 |
|
|
+ |
22 |
|
|
+# shall we run ? |
23 |
|
|
+status=$(/sbin/e-smith/db configuration getprop durep status || echo 'enabled') |
24 |
|
|
+if [[ "$status" == "disabled" ]]; then |
25 |
|
|
+ exit |
26 |
|
|
+fi |
27 |
|
|
+ |
28 |
|
|
+# original folders to be accounted |
29 |
|
|
/usr/local/bin/durep -q -x -sf /var/lib/durep/user.ds /home/e-smith/files/users |
30 |
|
|
/usr/local/bin/durep -q -x -sf /var/lib/durep/ibays.ds /home/e-smith/files/ibays |
31 |
|
|
+ |
32 |
|
|
+# known folder from contribs and from base |
33 |
|
|
+folders=( "/home/e-smith/files/ezmlm" "/home/e-smith/files/shares" "/home/e-smith/db" "/opt/webshare") |
34 |
|
|
+ |
35 |
|
|
+# user added folder to stat |
36 |
|
|
+userfolders=$(/sbin/e-smith/db configuration getprop durep folders || echo '') |
37 |
|
|
+ufolders=(${userfolders//,/ }) |
38 |
|
|
+folders=("${folders[@]}" "${ufolders[@]}") |
39 |
|
|
+for folder in "${folders[@]}" |
40 |
|
|
+do |
41 |
|
|
+ name=` echo ${folder//\//_}` |
42 |
|
|
+ #name=`basename $folder` |
43 |
|
|
+ if [ -d "$folder" ]; then |
44 |
|
|
+ /usr/local/bin/durep -q -x -sf /var/lib/durep/$name.ds $folder |
45 |
|
|
+ else |
46 |
|
|
+ if [ -f "/var/lib/durep/$name.ds" ];then |
47 |
|
|
+ rm /var/lib/durep/$name.ds -f |
48 |
|
|
+ fi |
49 |
|
|
+ fi |
50 |
|
|
+done |
51 |
|
|
+ |
52 |
|
|
+# make the stats viewable |
53 |
|
|
/usr/local/bin/durep -c /var/lib/durep/ |
54 |
|
|
chmod 666 /var/lib/durep/* |
55 |
|
|
chmod 777 /etc/e-smith/web/panels/manager/html/durep/*.cgi |
56 |
|
|
+ |
57 |
|
|
+# remove ds file not renewd for more than 24 hours |
58 |
|
|
+find /var/lib/durep/ -type f -iname *.ds -mtime +"1" |xargs rm -f |
59 |
|
|
+ |