=========================
OpenFTPD MANUAL: SECTIONS
=========================

1. INTRODUCTION

The sections give you a possibility to have seperated upload/download stats 
and configuration settings dependent on the path in your site tree.


2. SECTION CONFIGURATION

The sections are set in "etc/sections.cfg" and you can have a seperated
config file (like the registry) and seperated stats for each section.

Multiple sections can use the same config or stat files. But section
name and path should be unique. Of course it's possible to have one section
in "/Video" and another seperated one in "/Video/Family". The function to
detect the current section checks always the the path with the biggest
length first.

If you have two dirs "/Video" and "/Music" for example you can add two
sections the the sections.cfg

MUSIC    music.cfg   music.stat  /Music
VIDEO    video.cfg   video.stat  /Video

This will require that you have the 2 config files "music.cfg" and 
"video.cfg" in the path "etc/sections". If those files does not exists
the "default.cfg" is used instead.


3. STATISTIC FILES

The text stat files used by external scripts are stored to the path you set 
in the registry for "statdir" by default "var/log/stats". The binary stat files
used by OpenFTPD itself are stored in "etc/stats". The file "music.stat" for
example contains the upload/download statistic of the section MUSIC for all 
users in binary format. 

So if a user uploads a files to /Music or a subdir of it, the stats are 
changed for the section MUSIC (and the global stats which are still saved
in the userfile) and later saved to "music.stat".

If you send a USR1 signal to the ftpd (killall -SIGUSR1 ftpd) it will dump
the stats in a ascii text format that can be used by scripts.

In our example this would create the files "music.txt" and "video.txt" for 
our both sections, a "default.txt" for all other diretories and a 
"global.txt" with the total stats of all sections.

The text stat files have the format
      name:info:groupname:groupinfo:
      dl_f_day:dl_day:dl_tm_day:ul_f_day:ul_day:ul_tm_day:
      dl_f_week:dl_week:dl_tm_week:ul_f_week:ul_week:ul_tm_week:
      dl_f_month:dl_month:dl_tm_month:ul_f_month:ul_month:ul_tm_month: 
      dl_f_year:dl_year:dl_tm_year:ul_f_year:ul_year:ul_tm_year:
      dl_f_total:dl_total:dl_tm_total:ul_f_total:ul_total:ul_tm_total  
					
one line for each user.


4. CONFIG FILES

The config files for the sections work exactly like the registry. They 
contain a list of key - value pairs.

Not all settings in these files are used by OpenFTPD directly, some are 
used by external scripts. Currently these settings are used by OpenFTPD:

If you want to 

   { "del_empty_nuke"                   , D_BOOL , "no"           },
   { "different_credit"                 , D_BOOL , "no"           },
   { "download_limit"                   , D_INT  , "-1"           },
   { "empty_nuke"                       , D_INT  , "25"           },
   { "no_global_stats"                  , D_BOOL , "no"           },
   { "nukeprefix"                       , D_CHAR , "_NUKED_"      },
   { "show_dirstat"                     , D_BOOL , "yes"          },
   { "upload_limit"                     , D_INT  , "-1"           },


nukeprefix       - string added to nuked directories
empty_nuke       - size to remove for empty nukes in mb
del_empty_nuke   - delete nuked and empty directories ?
show_dirstats    - show directory stats in this section ?
no_global_stats  - stats from this section are not added to the global ones
different_credit - use seperated credits for this section
upload_limit     - set a different upload_limit for this section
download_limit   - set a different download_limit for this section


--- EOF ---
