To send files the AFD always looks in certain user defined directories for files which will then be send via FTP, e-mail, or some other service. These can be specified by using wildcards in a special configuration file.
The AFD consists mainly of two programs: AMG (Automatic Message Generator) and the FD (File Distributor). These two programs communicate over a fifo and a directory as shown below:
Every time the AMG finds files to be send, it copies (or if possible links) the files into the files directory and then generates a message which is then send via the fifo to the FD. The FD just needs to watch the fifo to see if it has to send any files. The message together with the file(s) is called a job. Such a job can consist of one or more files. For each job the AMG must create a directory in the files directory. Since some Unix implementations limit the number of directories (links) in one directory to 1000 (System V), it is necessary to monitor this number carefully.
This setup has the advantage that when a system crash occurs, no data is lost. After a crash we can start off from where we left before the crash. No data is lost and the worst thing that can happen is that a file gets send twice.
A step by step description what happens as a file is send via AFD can be viewed in What happens when a file goes through AFD.
The afd_ctrl is the user interface, which can be used to monitor and control the AFD. With this interface it is possible to start/stop the AMG or the FD on a per host basis or turn on/off the AMG or FD.
There are currently seven types of log files: system, receive, transfer, transfer debug, input, output and delete. In the system log file only information regarding the AFD system is being logged. The transfer log shows how many files and bytes have been transferred on a per host basis. Errors that might occur during or be for the transfer are also logged here in a very short form. If more information is wanted, the debug mode must be turned on and this information is then logged in the transfer debug log file.
When the FD has send a file successfully this file gets archived (if this was specified in the options field) in the archive directory. The process archive_watch checks this directory for old archives and removes them when it finds one. With the show_olog dialog it is then possible to resend files again.
All the above process are controlled by a single process called init_afd. This process keeps track of all running jobs of the AFD and restarts them if any of the critical process terminate abnormally. It also checks that all shared memory regions are released and the files directory does not have to many entries.
The directories that the AFD needs are listed as follows:
In the etc directory you will find all files to configure the AFD system: AFD_CONFIG, DIR_CONFIG, HOST_CONFIG, afd.name, afd.users, rename.rule, host.info and the group.transfer_rate_limit file.
The sbin directory will contain tools for the system administrator. See the tools section for more details.
It is not necessary to have the bin and sbin directory here. They can be located at any place but should be in the PATH environment variable. So it is possible to run several AFD's using the same set of binaries. In fact it is more common to have these in /us/bin and /usr/sbin, then there is no need to change the PATH variable.
The message directory will contain all the messages that are required to distribute the files by the FD. Only FD and show_olog will use them. These files will be in normal ASCII format so that the administrator has the chance to make quick changes without editing the DIR_CONFIG file. These changes will be effective immediately. This can be very useful when a remote user has changed his password and AFD has a lot of jobs queued up with this message type.
Copyright © 1997 - 2013 by H.Kiehl Holger.Kiehl@dwd.de Last updated: 24.11.2013 |
Index | Home |