AFD Tools


AFD has many small programs that can be used to view, control or configure it via command line. These files are located in the directory $AFD_WORK_DIR/sbin. Here follows a description of some of the tools:

AFD commands (afdcmd)

With this program you can send most commands that you can also issue with the afd_ctrl and dir_ctrl dialog on a per host or directory basis. When you call afdcmd without any parameters it will show all commands it knows:

   SYNTAX  : afdcmd[ -w working directory][ -p <role>][ -u[ <user>]] options hostname|directory|position [... hostalias|diralias|position n]
       FSA options:
                  -q              start queue
                  -Q              stop queue
                  -t              start transfer
                  -T              stop transfer
                  -g              enable delete data for host
                  -G              disable delete data for host
                  -h <pos> <name> change real hostname to <name>
                  -e              enable host
                  -E              disable host
                  -s              switch host
                  -r              retry
                  -d              enable/disable debug
                  -c              enable/disable trace
                  -C              enable/disable full trace
                  -I              enable/disable simulate send mode
                  -X              toggle enable/disable host
       FRA options:
                  -b              enable directory
                  -B              disable directory
                  -j              start directory
                  -J              stop directory
                  -R              rescan directory
                  -U              toggle start/stop directory
                  -W              toggle enable/disable directory
   General options:
                  -f              start FD
                  -F              stop FD
                  -a              start AMG
                  -A              stop AMG
                  -Y              start/stop AMG
                  -Z              start/stop FD
                  -k              force file dir check
                  -i              reread local interface file
                  -o              show exec statistics
                  -O              force search for old files
                  -P              force archive check
                  -v              just print Version

In conjunction with cron you can enable/disable certain hosts and control when they should receive their data. You may specify more than one hostname or position.

AFD configuration (afdcfg)

The program afdcfg allows you to enable/disable archiving and/or retrieving of files from remote hosts. The disabling of archiving can be useful when you notice that your disk space gets to low or you want to reduce the load on the node. The other option to enable/ disable retrieving of files is good when you have two nodes with identical configured AFD's and one node is configured as hot standby. This will make sure that only the AFD on the active node will retrieve data. Otherwise both AFD's will retrieve the data and that can be quit annoying. The syntax of afdcfg is as follows:

   SYNTAX  : afdcfg [-w working directory] [-p ] [-u []] options
             -a                      enable archive
             -A                      disable archive
             -b                      enable create source dir
             -B                      disable create source dir
             -c                      enable create target dir
             -C                      disable create target dir
             -d                      enable directory warn time
             -du                     enable + update directory warn time
             -D                      disable directory warn time
             -h                      enable host warn time
             -H                      disable host warn time
             -i                      enable simulate send mode
             -I                      disable simulate send mode
             -o <errors offline>     modify first errors offline
             -r                      enable retrieving of files
             -R                      disable retrieving of files
             -s                      status of the above flags
             --save_status <name>    store status of the above flags to file <name>
             --recover_status <name> recover status from file <name>

View FSA (fsa_view)

To view the content of the FSA (Filetransfer Status Area) there is a program called fsa_view. An example output might look as follows:

afd@kamino:~$ fsa_view fiau_
    Number of hosts: 91   FSA ID: 13  Struct Version: 4  Pagesize: 4096
    First errors offline: 2

=============================> fiau_ (1) <=============================
Host alias CRC       : e831dc61
Real hostname 1      : localhost
Real hostname 2      :
Hostname (display)   : >fiau_<
Host toggle          : HOST_ONE
Auto toggle          : OFF
Original toggle      : NONE
Toggle position      : 5
Protocol(   40000081): FTP passive check_size SFTP
Direction            : SEND
Socket send buffer   : Not set
Socket rcv buffer    : Not set
Keep connected       : 120
Proxy name           : >$Udwd@ifu;$Pgtswetter<
Debug mode           : OFF
Dupcheck timeout     : Disabled
Host status ( 147456): STORE_IP WARNING_STATUS
Transfer timeout     : 10
File size offset     : -1
Successful retries   : 0
MaxSuccessful ret.   : 10
Special flag ( 64)   : HOST_IN_DIR_CONFIG
Error counter        : 0
Total errors         : 0
Max. errors          : 10
Error history        : 000 -> Transfer success
                       000 -> Transfer success
                       000 -> Transfer success
                       000 -> Transfer success
                       000 -> Transfer success
Retry interval       : 600
Transfer block size  : 524288
TTL                  : 0
Time of last retry   : Sat Aug 28 14:22:25 2021
Last connection      : Sat Aug 28 14:22:25 2021
First error time     : Not set.
Start event handle   : Not set.
End event handle     : Not set.
Warn time            : 86400
Total file counter   : 0
Total file size      : 0
File counter done    : 0
Bytes send           : 0
Connections          : 0
Jobs queued          : 0
Active transfers     : 0
Allowed transfers    : 2
Rate limit           : 0
Rate limit per proc  : 0
                    |   Job 0   |   Job 1   
--------------------+-----------+-----------
PID                 |        -1 |        -1 
Connect status      |DISCONNECT |DISCONNECT 
Special flag        |         0 |         0 
Number of files     |         0 |         0 
No. of files done   |         0 |         0 
File size           |         0 |         0 
File size done      |         0 |         0 
Bytes send          |   3100838 |         0 
File name in use    |           |           
File size in use    |         0 |         0 
Filesize in use done|         0 |         0 
Unique name         |           |           
Job ID              |         0 |         0 

Under 'File name in use' will be shown the current file being transmitted. To view the full name use the '-l' option to show the long view:

-------- Job  0 -----+------------------------------------------------------
PID                  : -1
Connect status       : DISCONNECT
Special flag         : 0
Number of files      : 0
No. of files done    : 0
File size            : 0
File size done       : 0
Bytes send           : 3100838
File name in use     : 
File size in use     : 0
File size in use done: 0
Unique name          : 
Job ID               : 0
-------- Job  1 -----+------------------------------------------------------
PID                  : -1
Connect status       : DISCONNECT
Special flag         : 0
Number of files      : 0
No. of files done    : 0
File size            : 0
File size done       : 0
Bytes send           : 0
File name in use     : 
File size in use     : 0
File size in use done: 0
Unique name          : 
Job ID               : 0

View FRA (fra_view)

To view the content of the FRA (Fileretrieve Status Area), the directories monitored by AFD, there is a program called fra_view. The output looks as follows:

afd@kamino:~$ fra_view testmaus
     Number of directories: 108   FRA ID: 13  Struct Version: 8  Pagesize: 4096

=============================> testmaus (8) <=============================
Directory alias      : testmaus
Directory ID         : eaa95f01
URL                  : ftp://wfunk@testmaus
Dir mtime            : 0
ls data alias        :
Retrieve work dir    : /home/afd
Host alias           : testmaus
Wait for             :
FSA position         : 29
Priority             : 9
Number of process    : 0
Max number of process: 10
Bytes received       : 0
Files received       : 0
Files in directory   : 0
Bytes in directory   : 0
Files in queue(s)    : 0
Bytes in queue(s)    : 0
Accumulate size      : 0
Accumulate           : 0
gt_lt_sign           : 0
Create Dir Mode      : 0
Max errors           : 10
Error counter        : 0
Info time            : 0
Warn time            : 0
Keep connected       : 0
Ignore size          : -1
Ignore file time     : 0
Max files            : 100
Max size             : 104857600
Directory status( 12): NORMAL STATUS
Directory flag(16392): LINK_NO_EXEC
Dir options   (16384): INOTIFY_RENAME
In DIR_CONFIG flag   : DIR_ALIAS
Dupcheck timeout     : Disabled
Force reread         : NO
Queued               : 0
Remove files         : NO
Stupid mode          : NO
Protocol (   0)      : FTP
Delete input files   : NO
Report unknown files : YES
Important directory  : NO
End character        : NONE
Timezone             : Not set, taking system default
Time option          : 1
Next check time      : Sun Feb 26 14:17:00 2023
Minute (long long)   : 00000010 00010000 10000100 00100001 00001000 01000010 00010000 10000100
Continues (long long): 00000010 00010000 10000100 00100001 00001000 01000010 00010000 10000100
Hour (uint)          : 00000000 11111111 11111111 11111111
Day of month (uint)  : 01111111 11111111 11111111 11111111
Month (short)        : 00001111 11111111
Day of week (uchar)  : 01111111
Minute (long long)   : 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Continues (long long): 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Hour (uint)          : 00000000 00000000 00000000 00000000
Day of month (uint)  : 00000000 00000000 00000000 00000000
Month (short)        : 00000000 00000000
Day of week (uchar)  : 00000000
Last retrieval       : Thu Jan  1 01:00:00 1970

This program can take two parameters -s and -d. -s will only print out the dir_alias and if the directory has been stopped or not. -d has the same meaning for disabled directories.

AFD Status (afd_status)

The program afd_status prints the current status of the AFD that is displayed at the bottom row of the afd_ctrl dialog.

Hostname              : ducktown
Working directory     : /home/afd
User name + ID        : afd (9999)
AMG                   : 1
AMG jobs status flag  : 0
FD                    : 1
System log            : 1
Maintainer log        : 1
Event log             : 1
Transfer log          : 1
Trans debug log       : 1
Archive watch         : 1
afd_stat              : 1
afdd                  : 1
afdds                 : 1
input_log             : 1
output_log            : 1
delete_log            : 1
production_log        : 1
distribution_log      : 1
ALDA daemon           : 1
Receivelog indicator  : 155 < I I W I I >
Receive log history   : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? I E ? ? ? ? ? I I ? I I I I W W W W I
Syslog indicator      : 787 < I I I I I >
System log history    : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? W W C I W C C W I W W W I I W W I W W
Translog indicator    : 2317 < I I I I I >
Transfer log history  : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? I I I I I I I I I I I I I I E E I E I
Number of transfers   : 0
Number of retrieves   : 0
Jobs in queue         : 0
AMG fork() counter    : 6
FD fork() counter     : 1213
Burst2 counter        : 4
AMG child user time   : 0.26994
AMG child system time : 0.20995
FD child user time    : 0.28980
FD child system time  : 0.179952
Max. FD queue length  : 17
Directories scanned   : 2418
Inotify events handled: 12744
AFD start time        : Thu Jan 19 20:29:37 2006

The process status of each can have the following numbers:

-3 The process has stopped normally.
0 Process is not running.
1 Process is up and running.
19 Process is currently shutting down.

Edit FSA (fsa_edit)

The program fsa_edit can be used to edit the FSA (Filetransfer Status Area). When you use this program it will always show the current value that you might wish to manipulate as shown below:





                     FSA Editor (fiau)

        +-----+------------------+----------------+
        | Key | Description      | current value  |
        +-----+------------------+----------------+
        |  1  |total_file_counter|              0 |
        |  2  |total_file_size   |              0 |
        |  3  |error counter     |              1 |
        |  4  |No. of connections|             26 |
        |  5  |host status       |              0 |
        |  6  |Max. errors       |             10 |
        |  7  |Block size        |           1024 |
        |  8  |Allowed transfers |              2 |
        |  9  |Transfer timeout  |            120 |
        |  a  |Real hostname     |      127.0.0.1 |
        |  b  |Host display name |           fiau |
        |  c  |Error offline stat|            YES |
        |  d  |Active transfers  |              0 |
        |  e  |File name         |                |
        |  f  |Jobs queued       |              0 |
        |  g  |Transferrate limit|              0 |
        +-----+------------------+----------------+


If you wish to change for example the 'error counter' just press '3' and you will be asked to enter a value:





                     FSA Editor (fiau)

        +-----+------------------+----------------+
        | Key | Description      | current value  |
        +-----+------------------+----------------+
        |  1  |total_file_counter|              0 |
        |  2  |total_file_size   |              0 |
        |  3  |error counter     |              1 |
        |  4  |No. of connections|             26 |
        |  5  |host status       |              0 |
        |  6  |Max. errors       |             10 |
        |  7  |Block size        |           1024 |
        |  8  |Allowed transfers |              2 |
        |  9  |Transfer timeout  |            120 |
        |  a  |Real hostname     |      127.0.0.1 |
        |  b  |Host display name |           fiau |
        |  c  |Error offline stat|            YES |
        |  d  |Active transfers  |              0 |
        |  e  |File name         |                |
        |  f  |Jobs queued       |              0 |
        |  g  |Transferrate limit|              0 |
        +-----+------------------+----------------+


     Enter value [3] :  _


Now enter the new value and send the new value to the FSA with the return key. If you wish to terminate the program just press the q key.

Please use this program with caution! Only use it when you know what you are doing.

Update DIR_CONFIG (udc)

When there is a change in the DIR_CONFIG and you do not want to use the afd_ctrl dialog to activate this DIR_CONFIG just use udc.

Update HOST_CONFIG (uhc)

When there is a change in the HOST_CONFIG and you do not want to use the afd_ctrl dialog to activate this HOST_CONFIG just use uhc.

Both udc and uhc return 0 when the update was performed successfully. On error either 3 or -1 is returned. If it returns 2 the update was done but there are warnings, meaning that you have to check the SYSTEM_LOG for possible errors in DIR_CONFIG or HOST_CONFIG.

Get DIR_CONFIG data (get_dc_data)

The program get_dc_data shows what AFD has stored internally that it has found in the given configuration (DIR_CONFIG).

The syntax is as follows:

   Usage: get_dc_data [-c <config name 0> [.. <config name n>]]
                      [-C <config hex id 0> [.. <config hex id n>]]
                      [-d <dir alias>]
                      [-D <dir hex id>]
                      [-h <host alias> [--only_list_target_dirs]]
                      [-H <host alias 0> [.. <host alias n>]]
                      [--show-pwd]

If no argument is given, the content of all DIR_CONFIG's as stored within AFD will be printed to stdout. So with this command you can reconstruct the DIR_CONFIG if you lost it or it is damaged and AFD is still active.

The output looks as follows when a host alias is given with the -h parameter and the alias name:

    DIR_CONFIG    : /home/afd/etc/DIR_CONFIG
    Directory     : /home/afd/data/mfa
    Dir-alias     : MRZ
    DIR-options   : time */5 * * * *
    Filter        : G1*
                    G2*
                    G3*
                    G4*
    Recipient     : ftp://user:passwd@host//data/mfa
    Real hostname : 127.0.0.1
    AMG-options   : extract MRZ
    FD-options    : archive 1
    Priority      : 6
    Job-ID        : 1c7eafb9

If the alias has more then one job, they will be listed one after the other each separated by an empty line.

Showing the content of a specific directory (parameter -d or -D) will show the data in a format as used in DIR_CONFIG.

The parameters -c and -C are used to show just the job ID's that are used in the given DIR_CONFIG. The output will look as follows when calling it as follows: get_dc_data -c ~/oper/etc/DIR_CONFIG.timezone ~/oper/etc/configs/my.dir

   /home/afd/oper/etc/DIR_CONFIG.timezone (352c2d39) with 13 Job ID's:
   #1b5fb339 #95b838e5 #cab145eb #acd279b7 #d68e550e #84800b9 #6b4c484a #9672a4b
   #aa4601a9 #534b2ee4 #f9ba30f #58739be4 #e591c849
   /home/afd/oper/etc/configs/my.dir (e71e0201) with 1 Job ID's:
   #4fff828a

Get job data (jid_view)

The program jid_view shows all parameters of an internal AFD job. The output looks as follows when a job ID is given as the first argument:

    Job-ID          : 66cd75e8
    DIR_CONFIG      : /home/afd/oper/etc/DIR_CONFIG
    DIR_CONFIG-ID   : f4f6d93c
    Source-Directory: ~afdftp/outgoing/filepool/volc1/R6/SN/
    Local-Source-Dir: /home/afdftp/outgoing/filepool/volc1/R6/SN/
    Dir-ID          : c3046a9d
    Dir position    : 46
    File filters    : *.bin
                      *.txt
    File-Mask-ID    : f7b343cc
    Destination     : ftp://foo@mss_//tmp
    Destination-ID  : 91edd4f0
    Host alias      : mss_
    Host-Alias-ID   : 3db112ef
    Real hostname   : idefix [localhost]
    Priority        : 9

If no argument is given, all jobs in AFD will be printed to stdout.

Show exec statistics (show_exec_stat)

If called will cause dir_check to print out some exec statistics about CPU usage in SYSTEM_LOG. This is very useful to find the jobs that cause most of the load. Below is an example output:

   10 14:40:06 <D> CPU clock times for exec option:
   10 14:40:06 <D> Job ID     Forks      User       System     Total
   10 14:40:06 <D> 4b5313cf   3          78         14         92

This statistic will always be printed when dir_check terminates.

Remove a job (rm_job)

To remove a job from the AFD system there is the program rm_job <full job name>. To get the full job name just look into the files directory. To delete for example all jobs with the job ID 999 the following command will do this for you: rm_job `find $AFD_WORK_DIR/files -name "*_999" -print` Currently rm_job can only delete outgoing jobs, not those that are fetching files from a remote host.

Set password (set_pw)

If you do not want to store passwords in the DIR_CONFIG you can set them with this program. The syntax is as follows:

   Usage: set_pw [options] -i <job id>|-c <user@hostname>
                    -e 0|1|2           Encryption type to use.
                                         0 clear plain text
                                         1 AFD internal version (default)
                                         2 simple XOR encryption
                    -s                 Read from stdin.
                    -t                 Write to stdout.
                    -u <user>          Fake user.
                    --version          Version number.
                    -w <AFD work dir>  Set AFD working directory.

All passwords are stored at one location within AFD regardless if you have the password in DIR_CONFIG or you use set_pw. If you have the password in DIR_CONFIG and you set it with set_pw, always the last set password will be used by AFD. In the case of DIR_CONFIG the password will ALWAYS be set when you do a reread DIR_CONFIG. Also note that when you have in DIR_CONFIG multiple entries of the same username and hostalias and you remove all the passwords except for one. AFD will still always take the password from DIR_CONFIG each time you reread DIR_CONFIG. The identifier for a password within AFD is always the username and hostalias ie. username@hostalias. And this will be stored only once.

To explain it better, lets use an example. Say in DIR_CONFIG you have the following recipient:

     ftp://donald:secret@hollywood//home/user

If you reread DIR_CONFIG then AFD will have in its password database a entry donald@hollywood with its password. If you now set the password with set_pw (set_pw -c donald@hollywood) to secret2, AFD will from this time onwards always use secret2 for donald@hollywood. If you now reread DIR_CONFIG it will now use secret as password, ie. it will overwrite the password from set_pw.

So if you always have put all passwords in DIR_CONFIG you can remove all passwords from it and everything should work as expected. To remove the password use the following syntax:

     ftp://donald@hollywood//home/user

Do NOT use this syntax:

     ftp://donald:secret@hollywood//home/user

The above will always remove any password when rereading DIR_CONFIG.

You can also set the password by putting it once in DIR_CONFIG, reread the DIR_CONFIG, remove the password from DIR_CONFIG and then reread DIR_CONFIG again. The password is now always set within AFD.

By default AFD uses its own internal 'encryption' when storing the password in the internal database. You can choose a different encryption type with the -e parameter. There are currently 3 different types supported: 0, 1 and 2. 0 is in clear plain text. 1 is the AFD internal version. And 2 is a simple XOR encryption with a key that you need to specify in $AFD_WORK_DIR/etc/.xor.key or by compiling it in with the configure option --with-xor-key=KEY.

AFD monitor commands (mafdcmd)

With this program you can send many commands that you can also issue with the mon_ctrl dialog on a per AFD basis. When you call mafdcmd without any parameters it will show all commands it knows:

   SYNTAX  : ./mafdcmd [-w working directory] options AFD|position
                                              -e          enable AFD
                                              -E          disable AFD
                                              -r          retry
                                              -s          switch AFD
                                              -X          toggle enable/disable AFD
                                              -u[ <user>] fake user
                                              -v          just print Version

You may specify more than one AFD or position.

Automatic FTP (aftp)

aftp is a tool small tool that sends or retrieve file(s) via FTP without any user interaction, so it can be used from any shell scripts or programs such as xsend_file. The syntax of aftp is as follows:

   SYNTAX: [t|r]aftp [options] [file 1 ... file n]

      When calling it with raftp files will be retrieved from the
      given host, otherwise (when using aftp) files will be send to that host.

     OPTIONS                              DESCRIPTION
     --version                          - Show current version
     -a <file size offset>              - Offset of file name when doing a LIST
                                          command on the remote side. If you
                                          specify -2 it will try to determine
                                          the size with the SIZE command.
     -b <block size>                    - FTP block size in bytes. Default 4096
                                          Bytes.
     -c <config file>                   - Configuration file holding user name,
                                          password and target directory in URL
                                          format.
     -C[ <mode>]                        - If target directory does not exist create
                                          it. The optional mode can be used to
                                          set the permission of this directory.
     -d <remote directory>              - Directory where file(s) are to be stored.
     -f <filename>                      - File containing a list of filenames
                                          that are to be send.
     -h <host name | IP number>         - Hostname or IP number to which to
                                          send the file(s).
     -I                                 - Enable implicit FTPS. Works only with -z or -Z. 
     -k                                 - Keep FTP control connection with STAT
                                          calls alive/fresh.
     -l <DOT | DOT_VMS | OFF | xyz.>    - How to lock the file on the remote site.
     -m <A | I | D>                     - FTP transfer mode, ASCII, binary or DOS.
                                          Default is binary.
     -o <mode>                          - Changes the permission of each file
                                                distributed.
     -p <port number>                   - Remote port number of FTP-server.
     -P <proxy procedure>               - Use the given proxy procedure to
                                          login. See documentation for more
                                          details on syntax.
     -u <user> <password>               - Remote user name and password. If not
                                          supplied, it will login as anonymous.
     -r                                 - Remove transmitted file.
     -S <buffer size>                   - Socket send buffer size
                                          (in bytes).
     -t <timout>                        - FTP timeout in seconds. Default 120s.
     -v                                 - Verbose. Shows all FTP commands and
                                          the reply from the remote server.
     -x                                 - Use passive mode instead of active
                                          mode when doing the data connection.
     -X                                 - Use extended mode active or passive
                                          (-x) mode.
     -y                                 - Use TLS legacy renegotiation.
     -Y                                 - Use strict SSL/TLS checks. 
     -z                                 - Use SSL/TLS for control connection.
     -Z                                 - Use SSL/TLS for control and data
                                          connection.
     -?                                 - Display this help and exit.
     The following values are returned on exit:
          0 - File transmitted successfully.
          1 - Failed to connect.
          9 - SSL/TLS authentification error.
          2 - User name wrong.
          3 - Wrong password.
          4 - Failed to set ascii/binary mode.
          5 - Failed to send NLST command.
         10 - Failed to open remote file.
         11 - Error when writing into remote file.
         12 - Failed to close remote file.
         13 - Failed to rename remote file.
         14 - Remote directory could not be set.
         20 - Operation received timeout.
         28 - Connection reset by peer.
         29 - Connection refused.
         30 - Could not open source file.
         31 - Failed to read source file.
         17 - System error stat().
         34 - System error malloc().
         40 - Failed to read file name file.
         60 - Syntax wrong.

Automatic SFTP (asftp)

As aftp asftp can retrieve and send files via SFTP. The syntax of asftp is as follows:

   SYNTAX: [t|r]asftp [options] [file 1 ... file n]

      When calling it with rasftp files will be retrieved from the
      given host, otherwise (when using asftp) files will be send to that host.

     OPTIONS                              DESCRIPTION
     --version                          - Show current version
     -a                                 - Append file.
     -b <block size>                    - Transfer block size in byte. Default 4096
                                          byte.
     -c <config file>                   - Configuration file holding user name,
                                          password and target directory in URL
                                          format.
     -C[ <mode>]                        - If target directory does not exist create
                                          it. The optional mode can be used to
                                          set the permission of this directory.
     -d <remote directory>              - Directory where file(s) are to be stored.
     -f <filename>                      - File containing a list of filenames
                                          that are to be send.
     -h <host name | IP number>         - Hostname or IP number to which to
                                          send the file(s).
     -l <DOT | DOT_VMS | OFF | xyz.>    - How to lock the file on the remote site.
     -o <mode>                          - Changes the permission of each file
                                          distributed.
     -p <port number>                   - Remote port number of SFTP-server.
     -u <user> <password>               - Remote user name and password.
     -r                                 - Remove transmitted file.
     -S <buffer size>                   - Socket send buffer size
                                          (in bytes).
     -t <timout>                        - SFTP timeout in seconds. Default 120s.
     -v                                 - Verbose. Shows all SFTP commands and
                                          the reply from the remote server.
     -?                                 - Display this help and exit.
     The following values are returned on exit:
          0 - File transmitted successfully.
          1 - Failed to connect.
          2 - User name wrong.
          3 - Wrong password.
          4 - Failed to set ascii/binary mode.
         10 - Failed to open remote file.
         11 - Error when writing into remote file.
         12 - Failed to close remote file.
         13 - Failed to rename remote file.
         14 - Remote directory could not be set.
         20 - Operation received timeout.
         28 - Connection reset by peer.
         29 - Connection refused.
         30 - Could not open source file.
         31 - Failed to read source file.
         17 - System error stat().
         34 - System error malloc().
         40 - Failed to read file name file.
         60 - Syntax wrong.

Automatic SMTP (asmtp)

asmtp is a tool small tool that sends file(s) via SMTP without any user interaction, so it can be used from any shell scripts or programs such as xsend_file. The syntax of asmtp is as follows:

   SYNTAX: asmtp [options] [file(s)]

     OPTIONS                      DESCRIPTION
     --version                  - Show current version
     -a <user@host>             - The address where the mail is sent to.
     -b <block size>            - Transfer block size in bytes. Default 4096
                                  Bytes.
     -c <config file>           - Configuration file holding user name,
                                  domain and SMTP server in URL format.
     -C <charset>               - Character set to be used.
     -e                         - Encode files in BASE64.
     -f <filename>              - File containing a list of filenames
                                  that are to be send.
     -h <hostname | IP number>  - Recipient hostname of this mail.
     -i <From-address>          - Address of who send the mail.
     -m <mailserver-address>    - Mailserver that will send this mail.
                                  Default is localhost.
     -n                         - File name is subject.
     -o <mail address>          - Where the receiver should send is reply.
     -p <port number>           - Remote port number of SMTP-server.
                                  Default 25.
     -r                         - Remove transmitted file.
     -s <subject>               - Subject of this mail.
     -t <timout>                - SMTP timeout in seconds. Default 120s.
     -T                         - Only test if recipient exist.
     -u <user>                  - The user who should get the mail.
     -v                         - Verbose. Shows all SMTP commands and
                                  the reply from the SMTP server.
     -x                         - Use TLS legacy renegotiation.
     -y                         - File name is user.
     -Y                         - Use strict SSL/TLS verification.
     -?                         - Display this help and exit.
     The following values are returned on exit:
          0 - File transmitted successfully.
          1 - Failed to connect.
          2 - User name wrong.
         10 - Failed to open remote file.
         11 - Error when writing into remote file.
         12 - Failed to close remote file.
         13 - Failed to rename remote file.
         14 - Remote directory could not be set.
         17 - System error stat().
         20 - Operation received timeout.
         28 - Connection reset by peer.
         29 - Connection refused.
         30 - Could not open source file.
         31 - Failed to read source file.
         34 - System error malloc().
         40 - Failed to read file name file.
         50 - Failed to send remote mail address.
         51 - Failed to send SMTP DATA command.
         60 - Syntax wrong.

Automatic WMO (awmo)

asmtp is a tool small tool that sends file(s) via WMO protocol without any user interaction, so it can be used from any shell scripts or programs such as xsend_file. The syntax of awmo is as follows:

   SYNTAX: [t]awmo [options] [file 1 ... file n]

     OPTIONS                              DESCRIPTION
     --version                          - Show current version
     -A                                 - Wait for an acknowledge from server.
     -b <block size>                    - Transfer block size in bytes. Default 4096
                                          bytes.
     -c <config file>                   - Configuration file holding user name,
                                          password and target directory in URL
                                          format.
     -f <filename>                      - File containing a list of filenames
                                          that are to be send.
     -h <host name | IP number>         - Hostname or IP number to which to
                                          send the file(s).
     -H                                 - File name is header
     -m <A | I | F>                     - WMO transfer type, ASCII, binary or Fax.
                                          Default is binary.
     -p <port number>                   - Remote port number of WMO-server.
     -r                                 - Remove transmitted file.
     -S <buffer size>                   - Socket send buffer size
                                          (in bytes).
     -t <timout>                        - WMO timeout in seconds. Default 120s.
     -v                                 - Verbose. Shows all WMO commands and
                                          the reply from the remote server.
     -?                                 - Display this help and exit.
     The following values are returned on exit:
          0 - File transmitted successfully.
          1 - Failed to connect.
         10 - Failed to open remote file.
         11 - Error when writing into remote file.
         12 - Failed to close remote file.
         20 - Operation received timeout.
         28 - Connection reset by peer.
         29 - Connection refused.
         30 - Could not open source file.
         31 - Failed to read source file.
         17 - System error stat().
         34 - System error malloc().
         40 - Failed to read file name file.
         60 - Syntax wrong.

AFD HTML list (ahtml_list)

This tool shows what AFD sees when evaluating a HTML directory listing to facilitate the creation of the correct [files] filter.

SYNTAX: ahtml_list [options] [URL|file]

  OPTIONS                      DESCRIPTION
  --version                  - Show current version
  -b <block size>            - Transfer block size in bytes. Default 4096
                               bytes.
  -c                         - Remove content file.
  -C                         - Do not remove content file.
  -E                         - Do not send expect.
  -f                         - Force href search only.
  -i <file name>             - Non standard index file name.
  -P <Proxy server>          - Proxy server.
  -p <port number>           - Remote port number of HTTP-server.
                               Default 80 or 443.
  -R <buffer size>           - Socket receive buffer size
                               (in bytes).
  -S <buffer size>           - Socket send buffer size
                               (in bytes).
  -t <timout>                - HTTP timeout in seconds. Default 120s.
  -u <URL>                   - When just evaluating a local file. This
                               allows adding a URL for testing.
  -v                         - Verbose. Shows more information.
  -x                         - Use TLS legacy renegotiation.
  -Y                         - Use strict SSL/TLS verification.
  -?                         - Display this help and exit.
  The following values are returned on exit:
       0 - File transmitted successfully.
       1 - Failed to connect.
      10 - Failed to open remote file.
      17 - System error stat().
      20 - Operation received timeout.
      28 - Connection reset by peer.
      29 - Connection refused.
      34 - System error malloc().
      60 - Syntax wrong.

Copyright © 2001 - 2024 by H.Kiehl
Holger.Kiehl@dwd.de
Last updated: 02.04.2024
[red dot]Index [red dot]Home