%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %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 Setting up AFD Graphical User Interface %size 6 Configuration by examples %size 4 Evaluating Log Data Performance and other considerations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Configuration by examples Simple configuration Send one file to multiple destinations Renaming files locally and/or remotely Sending files via mail The exec option Working with priorities Configuring checks for duplicates Exercise %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Simple configuration copying/moving files from one directory to another locally %font "typewriter", size 2.5 [directory] /home/afd/data/in [files] * [destination] [recipient] file://local//home/afd/data/out %font "normal" shorter form: %font "typewriter", size 2.5 [directory] ~afd/data/in [files] * [destination] [recipient] file://afd@local/data/out %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Send one file to multiple destinations %font "typewriter", size 2.5 [directory] ~afd/data/in [files] * [destination] [recipient] file://afd@local/data/out1 file://afd@local/data/out2 sftp://afd@local/data/out3 ftp://ftponly:secret@local//home/afd/data/out4 [options] create target dir %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Send different data to different destinations %font "typewriter", size 2 [directory] ~afd/data/in [files] out1* [destination] [recipient] file://afd@local/data/out1 [files] out2* [destination] [recipient] file://afd@local/data/out2 [files] out3* [destination] [recipient] sftp://afd@local/data/out3 [files] out4* [destination] [recipient] ftp://ftponly:secret@local//home/afd/data/out4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Selecting files from a directory %font "typewriter", size 2.5 [directory] ~afd/data/in [files] out1* [destination] [recipient] file://afd@local/data/out1 [files] !out1* * [destination] [recipient] file://afd@local/data/out2 sftp://afd@local/data/out3 ftp://ftponly:secret@local/data/out4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Source directory on a remote system %font "typewriter", size 2.5 [directory] ftp://ftp.dwd.de/pub/afd [dir options] do not remove store retrieve list time */10 * * * * [files] Changelog afd-*.bz2 patch-*.bz2 [destination] [recipient] file://afd@local/data/afd %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Renaming files locally %font "typewriter", size 3 $AFD_WORK_DIR/etc/DIR_CONFIG [directory] ~afd/data/in [files] * [destination] [recipient] file://afd@local/data/out [options] rename local_simple $AFD_WORK_DIR/etc/rename.rule [local_simple] * XYZ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Rename locally, complicated %font "typewriter", size 3 $AFD_WORK_DIR/etc/DIR_CONFIG [directory] ~afd/data/in [files] * [destination] [recipient] file://afd@local/data/out [options] rename local_complicated $AFD_WORK_DIR/etc/rename.rule [local_complicated] *_*_*_??? %?3%?2%?1_%*3_%*2_%*1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Rename locally, complicated (cont.) %font "typewriter", size 5 111_222_333_123 %pause *_*_*_??? %?3%?2%?1_%*3_%*2_%*1 %pause 321_333_222_111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Rename at target %font "typewriter", size 3 $AFD_WORK_DIR/etc/DIR_CONFIG [directory] ~afd/data/in [files] * [destination] [recipient] file://afd@local/data/out [options] trans_rename tree create target dir $AFD_WORK_DIR/etc/rename.rule [tree] *_*_*_* */*/*/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Sending files via mail Always remember mail is not reliable and not save! Also note that by default AFD will try to send its mail to localhost. If you do not want this you can use the server= parameter in the recipient string. Even better is to use the DEFAULT_SMTP_SERVER parameter in $AFD_WORK_DIR/etc/AFD_CONFIG file. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Simple example sending a picture via mail %font "typewriter", size 3 $AFD_WORK_DIR/etc/DIR_CONFIG [directory] ~afd/data/in/pictures [files] *.jpg [destination] [recipient] mailto://Holger.Kiehl@dwd.de [options] attach file subject "Picture %s" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Example sending mail to any destination %font "typewriter", size 3 $AFD_WORK_DIR/etc/DIR_CONFIG | $AFD_WORK_DIR/etc/rename.rule | [directory] | [mail_subject] ~afd/data/in/mail | *\\ *\\ * %*3 | [files] | [mail_target] *.txt | *\\ *\\ * %*2 | [destination] | [mail_filename] | *\\ * %*1 [recipient] | mailto://mail_out | | [options] | subject "%s" mail_subject | file name is target mail_target | attach file mail_filename | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page Mail to any destination (continued) So, if a file with the following name is put into the directory ~afd/data/in/mail: %font "typewriter", size 3.5 "afd.c Holger.Kiehl@dwd.de This is the AFD code." %font "normal", size 5 Will then have to following effect: %font "typewriter", size 3.5 To : Holger.Kiehl@dwd.de Subject : This is the AFD code. Attachment : afd.c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page The exec option This allows you to execute any command before AFD transmits the data. If one wants to resize the size of an image to a certain size one can use the following: %font "typewriter", size 3 $AFD_WORK_DIR/etc/DIR_CONFIG [directory] ~afd/data/in [files] * [destination] [recipient] file://afd@local/data/png [options] exec convert -geometry 848x480! %s resized_%s %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page The exec option (continued) The %s is the place holder for file name. If AFD picked up more then one file it executes the command for each file in a loop. The %s place holder can only be used 10 times for each exec line. If the user wants to put all file names at once on the exec command line, just use the * as shown below: %font "typewriter", size 3.5 [options] exec tar --remove-files -cf all_files.tar * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %page The exec option (continued) It is possible to path arguments to the exec command: %font "typewriter", size 3.5 -d Deletes the original file after executing the command regardless if the command was successful or not. -l This sets a lock so that only one process can be executed at one time for each file. -t