- Simple configuration copying/moving files from one directory to another locally $AFD_WORK_DIR/etc/DIR_CONFIG [directory] /home/afd/data/in [files] * [destination] [recipient] file://local//home/afd/data/out shorter form: $AFD_WORK_DIR/etc/DIR_CONFIG [directory] ~afd/data/in [files] * [destination] [recipient] file://afd@local/data/out - Send one file to multiple destinations $AFD_WORK_DIR/etc/DIR_CONFIG [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/data/out4 [options] create target dir Send different data to different destinations $AFD_WORK_DIR/etc/DIR_CONFIG [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/data/out4 Selecting files from a directory $AFD_WORK_DIR/etc/DIR_CONFIG [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 Source directory on a remote system $AFD_WORK_DIR/etc/DIR_CONFIG [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 - Renaming files locally and/or at target Rename locally, simple $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 Rename locally, complicated $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 Rename at target $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] *_*_*_* */*/*/* - 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. Simple example sending a picture via mail. $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" Complex example sending different files to different destinations with just one entry. $AFD_WORK_DIR/etc/DIR_CONFIG [directory] ~afd/data/in/mail [files] *.txt [destination] [recipient] mailto://mail_out [options] subject "%s" mail_subject file name is target mail_target attach file mail_filename $AFD_WORK_DIR/etc/rename-rule [mail_subject] *\ *\ * %*3 [mail_target] *\ *\ * %*2 [mail_filename] *\ * %*1 A file with the name "afd.c Holger.Kiehl@dwd.de This is the AFD code." will be send to Holger.Kiehl@dwd.de the attached filename will be afd.c and the subject of the mail will be "This is the AFD code.". - 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: $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 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: [options] exec tar --remove-files -cf all_files.tar * It is possible to path arguments to the exec command: -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