- 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. You can have as many AFD's running as long as they all have their own working directory, even under one user. - Overview of all configuration files All configuration files are in the directory $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 configuration: [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 Full documentation about DIR_CONFIG and it's options can be found here: http://www.dwd.de/AFD/html-en/dir_config.html HOST_CONFIG - This tells AFD something about the destination, mainly =========== the hostname: 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 It is best to use for this file the graphical user interface edit_hc. Full documentation can be found here: http://www.dwd.de/AFD/html-en/host_config.html http://www.dwd.de/AFD/html-en/edit_hc.html rename.rule - In this file you can specify how a file is to be =========== renamed and has the following syntax: [old-new] PGZE05_EGRR_*_* Z__C_EDZW_%tY%tm%*1\00_fax01,waf_swc_asia_000024_370060__EGRR.png So the filename PGZE05_EGRR_210000 will result to Z__C_EDZW_20120921000000_fax01,waf_swc_asia_000024_370060__EGRR.png Documentation about renaming can be found here: http://www.dwd.de/AFD/html-en/rename_rules.html afd.users - Here one can specify what a user may do within AFD. The ========= syntax looks as follows: afd all operator 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 A list of keywords can be found under the following link: http://www.dwd.de/AFD/html-en/afd_users.html 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. 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 mostly used settings: 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 A full list of all AFD_CONFIG options can be found here: http://www.dwd.de/AFD/html-en/afd_config.html - 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. 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. - 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: afd@idefix:~$ afd -s Starting AFD shutdown ... Done! 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. - 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: touch ~/test/aaaa