-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.out
163 lines (159 loc) · 7.07 KB
/
example.out
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
user@host:~/path/to/findNclean$./findNclean find -c ./findNclean.conf.example 2>&1 | grep -v 'Permission denied'
2017-03-13T02:04:02 10853 Start action: find
2017-03-13T02:04:02 10853 Config: ./findNclean.conf.example
2017-03-13T02:04:02 10853 Debug mode enabled
2017-03-13T02:04:02 10853 Config rules count: 2
2017-03-13T02:04:02 10853 Relative paths allowed. Current dir: /home/user/path/to/findNclean
2017-03-13T02:04:02 10853 Effective config content:
<Global>
DEBUG = true
REL_PATH_ALLOW = true
APPROVED_SUFFIX = .approved
</Global>
<Rule1 find/move old unused *.tmp files in /tmp, /var and current user home dir>
result_list = ./ancient-tmp.find-example.csv
search_path = /var/
search_path = /tmp/
search_path = ~/
type = f
name = .*\.tmp
accessed < 2017
move_path = ./
move_log = ./ancient-tmp.move-example.csv
move_log_err = ./ancient-tmp.move-example.err.csv
</Rule1>
<Rule2 The same as above but for small non-zero logs>
result_list = ./ancient-logs.find-example.csv
search_path = ~/
search_path = /var/
search_path = /tmp/
type = f
name = .*\.log(\.gz)?
size > 0
size <= 2M
accessed < 2017
move_path = ./
move_log = ./ancient-logs.move-example.csv
move_log_err = ./ancient-logs.move-example.err.csv
</Rule2>
2017-03-13T02:04:02 10853 All non-zero size existing result_list files will be preliminary backuped:
2017-03-13T02:04:02 10853 The following commands will be evaluated (you can copy-paste them to bash terminal as is):
find -P -O3 -- /var/ /tmp/ /home/user/ -regextype posix-extended \( \! -name \*$'\n'\* -type f -regex .\*/.\*\\.tmp \! -newerat 2017-01-01T00:00:00 -fprintf ./ancient-tmp.find-example.csv %y\;%s\;%TY-%Tm-%TdT%TH:%TM:%TS\;%AY-%Am-%AdT%AH:%AM:%AS\;%u\;%g\;%p\\n \) , \( \! -name \*$'\n'\* -type f -regex .\*/.\*\\.log\(\\.gz\)\? -size +0c \( -size -2097152c -o -size 2097152c \) \! -newerat 2017-01-01T00:00:00 -fprintf ./ancient-logs.find-example.csv %y\;%s\;%TY-%Tm-%TdT%TH:%TM:%TS\;%AY-%Am-%AdT%AH:%AM:%AS\;%u\;%g\;%p\\n \)
2017-03-13T02:04:02 10853 Wait for all background processes completion...
2017-03-13T02:04:06 10853 Completed in 4 sec
2017-03-13T02:04:06 10853 Found items count (filenames with newline was excluded from the search):
0 ./ancient-tmp.find-example.csv
7 ./ancient-logs.find-example.csv
7 total
2017-03-13T02:04:06 10853 WARNING: Some 'find' commands returned non-zero exit code, results could be incomplete or incorrect!
2017-03-13T02:04:06 10853 Exit codes list: 1
2017-03-13T02:04:06 10853 Finished action: find
user@host:~/path/to/findNclean$vim ./ancient-logs.find-example.csv
user@host:~/path/to/findNclean$mv ./ancient-logs.find-example.csv{,.approved}
user@host:~/path/to/findNclean$mv ./ancient-tmp.find-example.csv{,.approved}
user@host:~/path/to/findNclean$./findNclean mv -c ./findNclean.conf.example
2017-03-13T02:05:32 11141 Start action: mv
2017-03-13T02:05:32 11141 Config: ./findNclean.conf.example
2017-03-13T02:05:32 11141 Debug mode enabled
2017-03-13T02:05:32 11141 Config rules count: 2
2017-03-13T02:05:32 11141 Relative paths allowed. Current dir: /home/user/path/to/findNclean
2017-03-13T02:05:32 11141 Effective config content:
<Global>
DEBUG = true
REL_PATH_ALLOW = true
APPROVED_SUFFIX = .approved
</Global>
<Rule1 find/move old unused *.tmp files in /tmp, /var and current user home dir>
result_list = ./ancient-tmp.find-example.csv
search_path = /var/
search_path = /tmp/
search_path = ~/
type = f
name = .*\.tmp
accessed < 2017
move_path = ./
move_log = ./ancient-tmp.move-example.csv
move_log_err = ./ancient-tmp.move-example.err.csv
</Rule1>
<Rule2 The same as above but for small non-zero logs>
result_list = ./ancient-logs.find-example.csv
search_path = ~/
search_path = /var/
search_path = /tmp/
type = f
name = .*\.log(\.gz)?
size > 0
size <= 2M
accessed < 2017
move_path = ./
move_log = ./ancient-logs.move-example.csv
move_log_err = ./ancient-logs.move-example.err.csv
</Rule2>
2017-03-13T02:05:32 11141 All non-zero size existing move_log and move_log_err files will be preliminary backuped:
2017-03-13T02:05:32 11141 Start processing the following move lists in background:
0 ./ancient-tmp.find-example.csv.approved
2 ./ancient-logs.find-example.csv.approved
2 total
2017-03-13T02:05:32 11141 Wait for all background processes completion...
mv: cannot move '/var/log/openvpn/00004-test.log' to './00004-test.log': Permission denied
mv: cannot move '/var/log/openvpn/00009-tmp.log' to './00009-tmp.log': Permission denied
2017-03-13T02:05:32 11141 Completed in 0 sec
2017-03-13T02:05:32 11141 Moved items count (successful canceled failed move_log [move_log_err]):
0 0 0 ./ancient-tmp.move-example.csv ./ancient-tmp.move-example.err.csv
0 0 2 ./ancient-logs.move-example.csv ./ancient-logs.move-example.err.csv
0 0 2 total
2017-03-13T02:05:32 11141 Finished action: mv
removed '/dev/shm/findNclean.exch26957.tmp'
removed '/dev/shm/findNclean.exch24396.tmp'
user@host:~/path/to/findNclean$sudo ./findNclean mv -c ./findNclean.conf.example
2017-03-13T02:06:48 11394 Start action: mv
2017-03-13T02:06:48 11394 Config: ./findNclean.conf.example
2017-03-13T02:06:48 11394 Debug mode enabled
2017-03-13T02:06:48 11394 Config rules count: 2
2017-03-13T02:06:48 11394 Relative paths allowed. Current dir: /home/user/path/to/findNclean
2017-03-13T02:06:48 11394 Effective config content:
<Global>
DEBUG = true
REL_PATH_ALLOW = true
APPROVED_SUFFIX = .approved
</Global>
<Rule1 find/move old unused *.tmp files in /tmp, /var and current user home dir>
result_list = ./ancient-tmp.find-example.csv
search_path = /var/
search_path = /tmp/
search_path = ~/
type = f
name = .*\.tmp
accessed < 2017
move_path = ./
move_log = ./ancient-tmp.move-example.csv
move_log_err = ./ancient-tmp.move-example.err.csv
</Rule1>
<Rule2 The same as above but for small non-zero logs>
result_list = ./ancient-logs.find-example.csv
search_path = ~/
search_path = /var/
search_path = /tmp/
type = f
name = .*\.log(\.gz)?
size > 0
size <= 2M
accessed < 2017
move_path = ./
move_log = ./ancient-logs.move-example.csv
move_log_err = ./ancient-logs.move-example.err.csv
</Rule2>
2017-03-13T02:06:48 11394 All non-zero size existing move_log and move_log_err files will be preliminary backuped:
2017-03-13T02:06:48 11394 Start processing the following move lists in background:
0 ./ancient-tmp.find-example.csv.approved
2 ./ancient-logs.find-example.csv.approved
2 total
2017-03-13T02:06:48 11394 Wait for all background processes completion...
2017-03-13T02:06:48 11394 Completed in 0 sec
2017-03-13T02:06:48 11394 Moved items count (successful canceled failed move_log [move_log_err]):
0 0 0 ./ancient-tmp.move-example.csv ./ancient-tmp.move-example.err.csv
2 0 0 ./ancient-logs.move-example.csv ./ancient-logs.move-example.err.csv
2 0 0 total
2017-03-13T02:06:48 11394 Finished action: mv
removed '/dev/shm/findNclean.exch24681.tmp'
removed '/dev/shm/findNclean.exch11002.tmp'