%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %deffont "normal" xfont "times" %deffont "typewriter" xfont "courier new-r" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %default 1 area 90 90, leftfill, size 2, fore "black", back "white" %default 2 size 7, vgap 10, prefix " " %default 3 size 2, bar "gray70", vgap 10 %default 4 size 5, fore "black", vgap 30, prefix " " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %tab 1 size 5, vgap 40, prefix " ", icon box "black" 40 %tab 2 size 4, vgap 40, prefix " ", icon arc "black" 50 %tab 3 size 3, vgap 40, prefix " ", icon delta3 "black" 40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Agenda %size 4 Introduction Architecture of AFD Compiling %size 6 Setting up AFD %size 4 Graphical User Interface Configuration by examples Evaluating Log Data Performance and other considerations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Setting up AFD Environment variable AFD_WORK_DIR Overview of all configuration files Configuring actions Starting/Stopping AFD Exercise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Environment variable AFD_WORK_DIR When AFD runs it needs to know where it can find the configuration files and also knows where to store it's data you need to tell AFD it's working directory. There are two possible ways to do this: pass it via command line parameter -w setting the environment variable AFD_WORK_DIR= If you have only one AFD running under a user it is best to put the environment variable AFD_WORK_DIR into the .profile file of that user. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Environment variable AFD_WORK_DIR You can have as many AFD's running as long as they all have their own working directory, even under one user. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Overview of all configuration files All configuration files are in $AFD_WORK_DIR/etc. DIR_CONFIG This is the main configuration file. Via this file one controls the distribution of data. This and all the other configuration files are in plain ASCII. The layout of the file can best be shown in an example: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Overview of all configuration files (cont.) %font "typewriter", size 2.5 [directory] /home/gisc/data/png [dir options] delete unknown files time */5 * * * * [files] A_* [destination] [recipient] ftp://user@dwd/png/from_turkey wmo://austria:12012 sftp://user@congo/png/from_turkey [options] rename old-new priority 3 archive 2d %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Overview of all configuration files (cont.) Full documentation about DIR_CONFIG and it's options: %font "typewriter", size 4 http://www.dwd.de/AFD/html-en/dir_config.html %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Overview of all configuration files (cont.) HOST_CONFIG This tells AFD something about the destination, mainly the hostname: %font "typewriter", size 2.5 dwd:ftp.dwd.de::::2:10:300:4096:10:-2:120:0:0:0:0:0:0:0:0:0:0:0 austria:x.x.x.x::::1:10:30:4096:10:-1:30:0:0:0:0:0:0:0:0:0:60:0 congo:x.x.x.x::::4:10:360:4096:10:-2:120:0:0:0:0:0:0:0:0:0:0:0 %font "normal" Don't worry, there is a graphical user interface edit_hc that helps you to modify this file. Full documentation can be found here: %font "typewriter", size 4 http://www.dwd.de/AFD/html-en/host_config.html http://www.dwd.de/AFD/html-en/edit_hc.html %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Overview of all configuration files (cont.) rename.rule In this file you can specify how a file is to be renamed and has the following syntax: %font "typewriter", size 2.5 [old-new] PGZE05_EGRR_*_* Z__C_EDZW_%tY%tm%*1\\00_fax01,waf_swc_asia_000024_370060__EGRR.png %font "normal" So the filename PGZE05_EGRR_210000 will result to? %pause %font "typewriter", size 2.5 Z__C_EDZW_20120921000000_fax01,waf_swc_asia_000024_370060__EGRR.png %pause %font "normal" Documentation about renaming can be found here: %font "typewriter", size 4 http://www.dwd.de/AFD/html-en/rename_rules.html %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Overview of all configuration files (cont.) afd.users Here one can specify what a user may do within AFD. The syntax looks as follows: %font "typewriter", size 2.5 afd all afdoper afd_ctrl, info, show_slog, show_tlog, show_ilog, show_olog, list_limit 10000, show_rlog, show_dlog, show_tdlog, show_queue, view_dir_config, dir_ctrl, dir_info, view_jobs, afd_load, control_host, switch_host, debug, retry, delete_queue, startup, resend, disable, handle_events, show_elog, view_data, edit_afd_info view_only afd_ctrl, info, show_slog, show_tlog, show_ilog, show_olog, list_limit 1000, show_rlog, show_dlog, show_tdlog, show_queue, view_dir_config, dir_ctrl, dir_info, view_jobs, afd_load, show_elog %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Overview of all configuration files (cont.) If you have several different users using a single AFD, it is best to put all of them in the same group. Then you need to build AFD with the configure option --enable-group_can_write. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Overview of all configuration files (cont.) A list of keywords can be found under the following link: %font "typewriter", size 4 http://www.dwd.de/AFD/html-en/afd_users.html %font "normal" afd.name If this file does not exist the name of AFD shown in AFD dialogs will be the name of the host where it runs. To change this name just create a file name $AFD_WORK_DIR/etc/afd.name and as content the name you wish to give to the AFD. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Overview of all configuration files (cont.) AFD_CONFIG This file contains some parameter settings that are always read when some process of AFD start. Here follows a simple example of some of the most used settings: %font "typewriter", size 2.5 AFD_TCP_PORT 4444 TRUSTED_REMOTE_IP 192.168.124.* MAX_AFDD_CONNECTIONS 5 MAX_CONNECTIONS 20 MAX_PROCESS_PER_DIR 10 CREATE_SOURCE_DIR YES CREATE_TARGET_DIR NO MAX_COPIED_FILES 20 %font "normal" A full list of all AFD_CONFIG options can be found here: %font "typewriter", size 4 http://www.dwd.de/AFD/html-en/afd_config.html %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Configuring actions In $AFD_WORK_DIR/etc/action it is possible to define what AFD should do when for example some remote host is not reachable. If, for example the host dwd is not reached after 10 tries, AFD will try to execute the file $AFD_WORK_DIR/etc/action/target/error/dwd with the parameter 'start'. Once the host is reachable again it will again execute this script, only this time with the parameter 'stop'. One can configure similar actions for input directories of AFD as well. They are located in $AFD_WORK_DIR/etc/action/source/error. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Configuring actions (cont.) A different kind of action is the warn action. This is triggered when for a given time no data is transmitted or received in a given input directory. In both cases this can be configured via the 'warn time' [dir options]/HOST_CONFIG. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Starting/Stopping AFD Starting AFD is done via the executable afd. There are several ways you can use it to start AFD. The most common way is via the following command 'afd -a'. There are also two conditional ways to start an AFD. One is with -C parameter. This will only start AFD if it is not already running. The other way is via the -H parameter. Use the -H check if you are using a shared file system and you do the check from another node. Stopping AFD is done via the command 'afd -s'. The output will look as follows: %font "typewriter", size 2.5 afd@idefix:~$ afd -s Starting AFD shutdown ... Done! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Starting/Stopping AFD (cont.) If you want to do a silent shutdown use the -S. The -z parameter can also be used to shutdown AFD. This is mainly useful on a shared file system and you want to shutdown AFD from another node that also has the filesystem mounted. One can also prevent one from starting AFD. This is done via the -b parameter. And to remove the blocking one can use the -r parameter. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Exercise Start your AFD that you have compiled in the previous exercise. Then put a file with the file name aaaa into the input directory of your AFD. You can do this via the following command: %font "typewriter", size 4 touch ~/test/aaaa