Configuration

All configuration files are INI-style files.

In the tables below strings in single quotes must be given literally (case insensitive) and without the quotes.

The paths mentioned in the configuration files must be either absolute or relative to the working directory of the filetransfer process.

See: example Configuration files

Changed in version 0.6.0: - Host configuration is now only allowed in host configuration files. hosts_cfg in the application configuration and host_id in the sections [source] and [target] in job configurations are not optional any more when using FTP, FTPS or SFTP. - SFTP authentication keyfiles in host configurations must now have their type declared with key_type

Changed in version 0.7.0: - The password option in host configurations is now required except for SFTP when an authentication key is used. - Option name moved from section [notify] to the new section [job] in job configuration.

Application Configuration

This configuration contains some global properties. It is the file that is set with the --config option or the FILETRANSFER_CFG environment variable (see: Using filetransfer).

[global]

required

jobs_dir

path to directory with job configuration files

required

job_cfg_ext

extension for job configuration files

optional (default: .cfg)

hosts_cfg

path to hosts configuration file

required if FTP, FTPS or SFTP is used

collect_data

‘yes’ | ‘no’

collect data about transferred files and errors (default: no); the list will be shown in the notification email (can be overwritten in the job configuration)

mail_cfgs_dir

path to directory with mail configuration files

required if customized emails are used (see: Emails customization)

locks_dir

path to directory for lock files

required if single_instance is used in a job configuration

[logging]

optional

log_dir

path to base directory for log files

if not set the logging messages will go to the standard error stream

use_subdirs

‘yes’ | ‘no’

  • yes (default): the logfile will be named timestamp.log and placed in a sub directory named jobid

  • no: the logfile will be named jobid_timestamp.log and placed directly in the log_dir directory

msg_format

format string

default: %(asctime)s %(levelname)-8s %(message)s

log_level

log level name

default: INFO

disabled

‘yes’ | ‘no’

disable logging (default: no)

[sftp]

optional

key_rsa_file

path to RSA private key file

required if SFTP is used and key_type is set to ‘RSA’ with no key_file in a host configuration

key_rsa_pass

password for key_rsa_file

required if key_rsa_file is password protected

key_dsa_file

path to DSA private key file

required if SFTP is used and key_type is set to ‘DSA’ with no key_file in a host configuration

key_dsa_pass

password for key_dsa_file

required if key_dsa_file is password protected

key_ecdsa_file

path to ECDSA private key file

required if SFTP is used and key_type is set to ‘ECDSA’ with no key_file in a host configuration

key_ecdsa_pass

password for key_ecdsa_file

required if key_dsa_file is password protected

key_ed25519_file

path to Ed25519 private key file

required if SFTP is used and key_type is set to ‘Ed25519’ with no key_file in a host configuration

key_ed25519_pass

password for key_ed25519_file

required if key_ed25519_file is password protected

known_hosts

path to known_hosts file

required if SFTP is used and known_hosts is not set in a job configuration

[mail]

SMTP config

optional

host

(dns-name | ip)[:port]

required: SMTP server

security

‘STARTTLS’ | ‘TLS’

default: insecure connection

user

username

required

password

password

required

from_addr

from email address

required

[notify]

optional

mail_cfg

mail configuration file

default: default (see: Emails customization)

success

comma separated list of email addresses

receipients to notify if a job succeeded (default: empty list)

error

comma separated list of email addresses

receipients to notify if there was an error (default: empty list)

done

comma separated list of email addresses

receipients to notify in both cases (default: empty list)

Job Configuration

A job configuration file must have a name of the form JOB_ID.cfg (e.g. job001.cfg where job001 is the job id; the extension .cfg can be changed in the application configuration) and it must be saved in the jobs_dir directory as defined in the application configuration.

[job]

optional

name

job name

will be shown in the email (default: job id)

info

info about the job

optional; will be shown in the email

collect_data

‘yes’ | ‘no’

collect data about transferred files and errors (default: value set in the application configuration); the list will be shown in the notification email

single_instance

‘yes’ | ‘no’ | an arbitrary lock name

if set to yes only one instance of this job can run at a time, if set to a lock name only one instance of any job that uses the same lock name can run at a time; locks_dir must be set in application configuration (default: no)

ready_file

file name

the job will only run if this file is present in the source directory (it will not be transferred but deleted when the job finishes successfully)

retries

number of retries after the first attempt failed

except for configuration errors the whole job will re-run up to retries times (default: 0)

log_disabled

‘yes’ | ‘no’

disable logging (default: value of disable in section [logging] in the application configuration)

log_level

log level name

default: value of log_level in section [logging] in the application configuration

[source]

host_id

host id

required for FTP, FTPS, SFTP
if omitted path must be on the local filesystem

path

path to source directory

required

files

one or more filepatterns (comma separated)

required (UNIX shell-style wildcards pattern)

ignore

one or more filepatterns (comma separated)

default: .* (UNIX shell-style wildcards pattern)

recursive

‘yes’ | ‘no’

default: no

delete

‘yes’ | ‘no’

default: no

[target]

host_id

host id

required for FTP, FTPS, SFTP
if omitted path must be on the local filesystem

path

path to target directory

required

temp

‘dot’ | ‘ext:’.ext | ‘dir:’subdir

default: no temporary files are used

[notify]

optional

mail_cfg

mail configuration file

default: mail_cfg from application configuration (see: Emails customization)

success

comma separated list of email addresses

receipients to notify if the job succeeded (added to list from application configuration)

error

comma separated list of email addresses

receipients to notify if there was an error (added to list from application configuration)

done

comma separated list of email addresses

receipients to notify in both cases (added to list from application configuration)

Hosts Configuration

A hosts configuration contains sections each of them defining a configuration of a host. Such a host configuration can be referenced by setting the host_id in the [source] and [target] sections in a job configuration to the section name.

[{host_id}]

host_id must be unique

type

‘FTP’ | ‘FTPS’ | ‘SFTP’

required

host

(dns-name | ip)[:port]

required

user

username

required

password

password

required (SFTP: only if no authentication key is used)

timeout

timeout in seconds

optional; default: 0.0 = no timeout

passive_mode

‘yes’ | ‘no’

optional for FTP/S; default: yes

encrypt_data

‘yes’ | ‘no’

optional for FTPS; default: yes

dir_a_option

‘yes’ | ‘no’

optional for FTP/S; default: yes; sending the -a option with the DIR command (showing “hidden” files) can be disabled if the server does not understand it

keep_alive

interval in seconds

optional for FTP/S; default: 60.0 (0.0 = no keep alive); keeps the control connection alive during long file transfers

key_type

‘RSA’ | ‘DSA’ | ‘ECDSA’ | ‘Ed25519’

required for SFTP if an authentication key is used; if key_file is not set this will refer to the keyfile of the given type in the [sftp] section in the application configuration

key_file

path to private key file

optional for SFTP

key_pass

password for key_file

optional for SFTP (not used if key_file is not set)

known_hosts

path to known_hosts file

required for SFTP if not set in the application configuration