-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathREADME.reset
110 lines (65 loc) · 2.42 KB
/
README.reset
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
Quick guide for foo-reset:
--------------------------
Table of contents.:
* Introduction.
* Running.
* Using output for bot.
Introduction:
-------------
foo-reset is meant to be an alternative to glftpd's reset binary.
The differences (to my knowledge, since glftpd is not Open Source,
these are only guessings) are as follows:
* foo-reset does NOT reset nuke-stats. I dont know how glftpd-reset
'resets' the nuke-stats as it claims in the documentation.
* foo-reset handles more than 'n' sections. glftpd-reset has some
hardcoded value I have been told.
* foo-reset does NOT use glftpd userfile locking mechanism.
* foo-reest additionally adds a RESET logging event to the glftpd.log
file when resetting stats.
Please be aware that this is not an official glftpd tool. glftpd
user-files may change their appearence. Take backup of your userfiles
on regular basis - you have been warned !
Running:
--------
After building, you can run it like this:
./foo-reset [options] <ftpdata-folder>
options are:
-w, reset weekly stats
-d, reset daily stats
-m, reset monthly stats
ftpdata-folder is the path where user files and logs of glftpd
can be found. usually this is /glftpd/ftp-data
The following entries will be logged to glftpd.log
On errors:
RESETERROR: "Some error text"
On success:
RESET: "reset-type" "kbytes-up" "files-up" "seconds-up" "users-up" "kbytes-down" "files-down" "seconds-down" "users-down"
reset-type is one of WEEK or DAY or MONTH.
If you want the reset to be run automagically, you must put it to your crontab.
You can put it like the following (please refer to 'man 5 crontab' too, I am
no crontab expert!):
--
#
# daily stats reset
#
0 0 * * * /path/to/foo-reset -d /glftpd/ftp-data
#
# weekly stats reset
#
0 0 * * Sun /path/to/foo-reset -w /glftpd/ftp-data
#
# monthly stats reset
#
0 0 1 * * /path/to/foo-reset -m /glftpd/ftp-data
--
Dont worry that the reset programs might be started at the same time. There
is a locking-mechanism, which makes one wait for the other.
Using output for bot:
---------------------
You can use the RESET event in your sitebot tcl like this (find the appropriate
place to put it yourself):
RESET: {
putserv "PRIVMSG #channel :[lindex $args 0] stats reset. Period stats: UP [lindex $args 2]F/[lindex $args 1]Kb/[lindex $args 4]users, DOWN [lindex $args 6]F/[lindex $args 5]Kb/[lindex $args 8]users";
}
--
$Id: README.reset,v 1.1.1.1 2003/01/22 11:58:54 sorend Exp $