Simple Examples


Example 1

An example entry in the DIR_CONFIG file might look as follows:

      [directory]
      /usr/data/tmp

           [files]
           abc*

                [destination]

                     [recipient]
                     ftp://donald:secret@hollywood//home/user
                     mailto://daisy@hollywood

                     [options]
                     archive 3
                     priority 1

The result of this entry would be that all files starting with abc in the directory /usr/data/tmp would be send to the user donald via FTP with the password secret at hollywood and there stored in the directory /home/user. They will also be send to daisy via SMTP. All files will be send with the priority 1 and will be archived for three days. The ftp files will be send with a dot first and only when a file is completely transmitted will it be renamed to its original name.

Example 2

In the following example we want different options when we send mails to daisy. For this we need to split the two recipients so that each have their own options as follows:

      [directory]
      /usr/data/tmp

           [files]
           abc*

                [destination]

                     [recipient]
                     ftp://donald:secret@hollywood//home/user

                     [options]
                     archive 3
                     priority 1

                [destination]

                     [recipient]
                     mailto://daisy@hollywood

                     [options]
                     archive 3
                     attach file
                     priority 1

Now daisy gets the same files as in example 1 only this time the files are attached.

Example 3

If daisy should get more files we need to split up the above example another time:

      [directory]
      /usr/data/tmp

           [files]
           abc*

                [destination]

                     [recipient]
                     ftp://donald:secret@hollywood//home/user

                     [options]
                     archive 3
                     priority 1

           [files]
           abc*
           def*
           ghi*
           jkl*

                [destination]

                     [recipient]
                     mailto://daisy@hollywood

                     [options]
                     archive 3
                     attach file
                     priority 1

Daisy will now also get the additional files def*, ghi* and jkl*.

Example 4

The source directory for files can also be on another host. For this we just need to change the directory entry as follows:

      [directory]
      ftp://micky:mouse@ducktown//usr/data/tmp

           [files]
           abc*

                [destination]

                     [recipient]
                     ftp://donald:secret@hollywood//home/user
                     mailto://daisy@hollywood

                     [options]
                     archive 3
                     priority 1

The result of this entry will be similar to the one in example 1, only that in this example AFD will look every minute on the host ducktown in the directory /usr/data/tmp for the files.

If we do not like AFD to delete the files on the remote we can tell it via the [dir options] to not remove the files on the remote host:

      [directory]
      ftp://micky:mouse@ducktown//usr/data/tmp

           [dir options]
	   do not remove

           [files]
           abc*

                [destination]

                     [recipient]
                     ftp://donald:secret@hollywood//home/user
                     mailto://daisy@hollywood

                     [options]
                     archive 3
                     priority 1

Now AFD will collect the same files every minute and send them to donald and daisy. If one does not wish to send the same files again one can add the following option:

      [directory]
      ftp://micky:mouse@ducktown//usr/data/tmp

           [dir options]
	   do not remove
	   store retrieve list

           [files]
           abc*

                [destination]

                     [recipient]
                     ftp://donald:secret@hollywood//home/user
                     mailto://daisy@hollywood

                     [options]
                     archive 3
                     priority 1

With the option store retrieve list only new files or those where the date and/or size has changed will be collected. If one wants to increase the poll interval from 1 minute to 30 minutes, it needs to be done as follows:

      [directory]
      ftp://micky:mouse@ducktown//usr/data/tmp

           [dir options]
	   do not remove
	   store retrieve list
	   time */30 * * * *

           [files]
           abc*

                [destination]

                     [recipient]
                     ftp://donald:secret@hollywood//home/user
                     mailto://daisy@hollywood

                     [options]
                     archive 3
                     priority 1

There are several ways to specify a source directory. The following examples all result to the same directory:

      [directory] don_in
      /home/donald/data/in
      [directory] don_in
      ~donald/data/in
      [directory] don_in
      file://home/donald/data/in
      [directory]
      file://donald@don_in/data/in

don_in is the directory alias name. If this is not set AFD will assign one for it that will be CRC32 checksum of the directory string. This is not human readable, so if you want to see readable directory alias names in dialog dir_ctrl, set them.


Copyright © 1997 - 2013 by H.Kiehl
Holger.Kiehl@dwd.de
Last updated: 23.12.2013
[red dot]Index [red dot]Home