Iberonesia communications
From WikiNesia
Contents |
SETUP INSTRUCCIONS
You have to install the phyton
Copy the programs on the brewer program directory
- refresh.py 12 Kb 20/01/2007 00:58 -a--
- refreshdb.py 4 Kb 19/01/2007 21:55 -a--
- util.py 3 Kb 19/01/2007 21:51 -a--
- alive.py 3 Kb 18/01/2007 15:05 -a--
- client.ini 0 Kb 04/02/2007 14:37 -a--
- client.bat 0 Kb 04/02/2007 14:41 -a--
- CK.RTN 0 Kb 31/01/2007 13:31 -a--
You can download here client.zip
Edit the configuration file is the client.ini
- [global]
- brewerid=037
- working_dir=.
- servers=iberonesia
- proxy=proxy.inm.es:port
- [iberonesia]
- url=http://www.iberonesia.net/brewer
- db=www.iberonesia.net.db
- noproxy=yes
you only have to edit the brewerid to your brewer.
If you dont need a proxy comment the lines (put # at the beginnign of the line)
Edit client.bat program (calling by the routine Ck.rtn)
client.bat
python refresh.py -i c:\brewer\data
you only have to edit the brewer (-b) and the brewer data directory (-i )
if you want to save the errors and log edit the client.bat and put
python refresh.py -i c:\brewer\data 1>client.log 2>client_error.log
A list of all the files in the directory of brewer is obtained.
test
open an comand window cd to the brewer program directory and execute client.bat. The first time it takes a while before you see the message..... from the brewer menu call the routine "ck"
Important: reestart the windows after the installation.
How it works
If local data base of files does not exist, one from the information of the server is created: xxxx.dbf For each file of the list of files one requests the size and the md5sum that the server has on that file. For each file of the list of files, it is verified if the size or the present md5sum of the file has varied with respect to the information of the file in the data base. In such case, the file is sent to the servant, and the data base is updated.
All the communications with the servant are made “by blocks”, that is to say, the communications do not become file to file (would be too many) nor all the files simultaneously (too many data to transfer could cause that the servant fails).
Client configuration file
The client configuration file is used by both the refresh.py and alive.py programs. The default configuration file is client.ini.
The file is a plain ASCII INI file with the INI file syntax. The file consists of a global section and several servers sections, one for each server to send the files to.
The global section has the following properties:
- brewerid : brewer identifier of the brewer owner of the files to send.
- input : directory that contains the files to send.
- servers : comma separated list of server aliases. The files are sent to each server in this list.
- working_dir : directory where the local refresh database is stored.
- proxy : proxy url, if required. If not required, this property must not be present.
A server section is identified by the server alias (i.e. the alias is the name between the brackets), and it has the following properties:
- url : server url.
- db : local database filename. A local database (a simple data file) is created the first time client is run. The database path is determined by the rundir property and this db property.
- noproxy : if a proxy is specified in the global section, noproxy may be set to yes to use a direct connection (avoiding the proxy) to access this server.
Some of these properties may be overridden using command line parameters when executing refresh.py or alive.py.
Example:
[global] brewerid=033 input=c:\data servers=iberonesia working_dir=c:\refresh proxy=http://proxy.inm.es:3128 # iberonesia server [iberonesia] url=www.iberonesia.net/brewer db=www.iberonesia.net.db noproxy=yes
refresh.py options
Most of the refresh.py options may be configured though command line arguments or client.ini configuration file.
Any option specified in command line overrides the option in client.ini.
The mandatory options are (client.ini / argument) :
- working_dir : This option must be specified in client.ini. Directory where the local refresh database is stored.
- input / -i : File to process. If the given file is a directory, all files within will be processed.
- brewerid / -b : Brewer identifier of the brewer owner of the files to send.
- servers / -s : Comma separated list of server aliases. The files are sent to each server in this list.
The easiest way to configure the client is to specify all options in client.ini file (like the one above) and execute refresh.py without arguments; and execute with arguments overriding the client.ini options if you want any unusual operation, such as sending only certain files.
