Affa Configuration

From Nikoforge Wiki
Jump to: navigation, search

Contents

Affa configuration files

Affa reads the configuration from all files with extension .conf in the /etc/affa/ directory and all sub-directories. The jobs are configurated in the well known INI file format. A job configuration section starts with the jobname in square brackets followed by name=value properties. A section ends at the end of the file or at the beginning of the next section.

[samplejob]
remoteHostName=192.168.1.100
sshPort=22
Include=/root
Include=/home

Some properties can be defined multiple times (multivalue), where the order is meaningless. Section and property names are case sensitive. Only the characters A-Z a-z 0-9 . - _ (letters, digits, period, hyphen, underscore) are allowed for section names.

Most important Properties

remoteHostName

Name: remoteHostName
Value: FQHN or IP
Multivalue: no
Default: none
Description: FQHN or IP of the source host

remoteUser

Name: remoteUser
Value: account
Multivalue: no
Default: root
Description: The user account to be used with all ssh logins. May be case sensitive, e.g. Administrator account on Windows

Description

Name: Description
Value: text string
Multivalue: no
Default: none
Description: Any text that describes the job

TimeSchedule

Name: TimeSchedule
Value: HHMM
Multivalue: yes
Default: 2230
Description: The time the job will run. Use exactly 4 digits, no colon, no point.

status

Name: status
Value: enabled or disabled
Multivalue: no
Default: enabled
Description: When set to disabled, no cron entries will made. You can still run a job manually.

Include

Name: Include
Value: full path
Multivalue: yes
Default: none
Description: File or directory to back up

Exclude

Name: Exclude
Value: full path
Multivalue: yes
Default: none
Description: File or directory to be excluded from backup

RootDir

Name: RootDir
Value: full path
Multivalue: no
Default: /var/affa
Description: Where to store the backup archives.

scheduledKeep

Name: scheduledKeep
Value: integer >= 1
Multivalue: no
Default: 1
Description: How many of the scheduled backups to be kept

dailyKeep

Name: dailyKeep
Value: integer >= 0
Multivalue: no
Default: 7
Description: How many of the daily backups to be kept

weeklyKeep

Name: weeklyKeep
Value: integer >= 0
Multivalue: no
Default: 4
Description: How many of the weekly backups to be kept

monthlyKeep

Name: monthlyKeep
Value: integer >= 0
Multivalue: no
Default: 12
Description: How many of the monthly backups to be kept

yearlyKeep

Name: yearlyKeep
Value: integer >= 0
Multivalue: no
Default: 2
Description: How many of the yearly backups to be kept

EmailAddress

Name: EmailAddress
Value: name@domain.com
Multivalue: yes
Default: root
Description: The mail addresses, where the messages should be sent to.
Note: By default Affa only sends messages on errors, never on success (see property chattyOnSuccess).

RetryAttempts

Name: RetryAttempts
Value: integer >= 0
Multivalue: no
Default: 4
Description: When set to a value>0, Affa re-run a failed job RetryAttempts times with a delay of RetryAfter seconds.

RetryAfter

Name: RetryAfter
Value: seconds >= 0
Multivalue: no
Default: 900
Description: When set to a value>0, wait RetryAfter seconds before re-running the job after an error. Only applicable with RetryAttempts>0

RetryNotification

Name: RetryNotification
Value: yes or no
Multivalue: no
Default: no
Description: When set to no, Affa does not send an error message when a job has failed and RetryAttempts is configured. An error message is only send when the last attempt has failed.

NRPEtrigger

Name: NRPEtrigger
Value: hours
Multivalue: no
Default: 24
Description: NRPE reports a job as critical when the last successful run is older then NRPEtrigger hours. To exclude the job from monitoring set to a value < 0.

SambaShare

Name: SambaShare
Value: yes or no
Multivalue: no
Default: no
Description: Access to the job archives via CIFS protocol

SambaValidUser

Name: SambaValidUser
Value: local account
Multivalue: yes
Default: affa
Description: User who has permission to access the job archives via the CIFS protocol.

More Properties

preJobCommand and preJobCommandRemote

Name: preJobCommand, preJobCommandRemote
Value: path relative to /etc/affa/scripts/
Multivalue: yes
Default: none
Description: Scripts to be executed before a job run. The job name and type (scheduled, daily etc.) are passed as arguments to the program. The preJobCommandRemote scripts are copied to the remote server and then executed there. The scripts are executed in alphabetical order. Use a numerical prefix if you need a specific order e.g. 01scriptB, 02remotescriptA, 03scriptA. Use the included prescript-sample.pl and prescriptRemote-sample.pl as a starting point for own scripts.

postJobCommand and postJobCommandRemote

Name: postJobCommand, postJobCommandRemote
Value: path relative to /etc/affa/scripts/
Multivalue: yes
Default: none
Description: Scripts to be executed after a job run. The job name, the type (scheduled, daily etc.) and the exit code of the job run are passed as arguments to the program. The postJobCommandRemote scripts are copied to the remote server and then executed there. The scripts are executed in alphabetical order. Use a numerical prefix if you need a specific order e.g. 01scriptB, 02remotescriptA, 03scriptA. Use the included postscript-sample.pl and postscriptRemote-sample.pl as a starting point for own scripts.

dedup

Name: dedup
Value: yes or no
Multivalue: no
Default: no
Description: The purpose of the deduplication is to remove duplicate files to save backup space. When set to 'yes' file deduplication is run after the synchronization has been completed. It looks for files that have identical content, user, group and permissions and replace duplicates by hardlinks. Deduplication scans the just completed archive and the previous one, that usually is scheduled.0 and daily.0 or scheduled.0 and scheduled.1. Consider this scenario: A user has renamed directories or files. Rsync sees those as new ones and copies them. Deduplication finds the identical copies in the previous archive and replace them by hardlinks. To use deduplication the Freedup program needs to be installed. Affa actually runs freedup -upg scheduled.0 <previous_archive>.

dedupKill

Name: dedupKill
Value: yes or no
Multivalue: no
Default: no
Description: When set to 'no' the job ignores affa --kill or affa --killall when deduplication is running. This is useful in the context of killAt which is typically used to stop bandwith utilisation.

sshPort

Name: sshPort
Value: service port
Multivalue: no
Default: 22
Description: When sshd on the remote host listens on a non-standard port, set the port here.

ConnectionCheckTimeout

Name: ConnectionCheckTimeout
Value: seconds
Multivalue: no
Default: 120
Description: Affa checks the ssh connection before the rsync process is started and exits with an error after the configured time if the host did not respond.

BandwidthLimit

Name: BandwidthLimit
Value: integer>=0 kilobytes per second
Multivalue: no
Default: 0
Description: Limits the data transfer rate. A value of zero specifies no limit.

rsyncTimeout

Name: rsyncTimeout
Value: seconds
Multivalue: no
Default: 900
Description: Rsync exits after the configured time if no data was transferred. This avoids infinitely hanging in case of a network error.

rsyncCompress

Name: rsyncCompress
Value: yes or no
Multivalue: no
Default: yes
Description: Compress the transferred data. May be useful with slow internet connections. Increases CPU load on remote and backup host.

rsync--inplace

Name: rsync--inplace
Value: yes or no
Multivalue: no
Default: yes
Description: Set to no if the rsync version on the remote hist does not support this option.

rsync--modify-window

Name: rsync--modify-window
Value: integer >= 0
Multivalue: no
Default: 0
Description: When comparing two timestamps, rsync treats the timestamps as being equal if they differ by no more than the modify-window value. This is normally 0 for an exact match. A value >= 0 is useful if you can't get the clocks of the remote host and the Affa server in sync.

rsyncOptions

Name: rsyncOptions
Value: string
Multivalue: no
Default: none
Description: Addtional option string to be passed to rsync

localNice

Name: localNice
Value: -19...+19
Multivalue: no
Default: 0
Description: Run local rsync process niced.

remoteNice

Name: remoteNice
Value: -19...+19
Multivalue: no
Default: 0
Description: Run remote rsync process niced.

killAt

Name: killAt
Value: HHMM
Multivalue: no
Default: none
Description: The time at which a job will be killed if it was still running. You can use it for example to kill jobs that are running over the internet early in the morning so that your users have the full bandwidth available during office hours.

resumeKilledAt

Name: resumeKilledAt
Value: VALUE
Multivalue: no
Default: none
Description: The time at which a killed job will be resumed. This allows you to start earlier in the evening than the scheduled time.

chattyOnSuccess

Name: chattyOnSuccess
Value: integer >= 0
Multivalue: no
Default: 0
Description: When set to a value>0, Affa sends a message on a successfully completed job run and decrements the chattyOnSuccess value. When the value has reached zero, Affa falls back to the default and only sends messages on errors.

AutomountDevice and AutomountPoint

Name: AutomountDevice, AutomountPoint
Value: full path
Multivalue: no
Default: none
Description: Device and mountpoint of backup device (e.g. USB disk). Device is automounted before a job starts and unmounted after job completion. With both properties empty no automount is done.

AutomountOptions

Name: AutomountOptions
Value: string
Multivalue: no
Default: none
Description: An option string passed to the mount command.

AutoUnmount

Name: AutoUnmount
Value: yes or no
Multivalue: no
Default: yes
Description: When set to 'no' the automounted device stay mounted after the Affa run.

Debug

Name: Debug
Value: yes or no
Multivalue: no
Default: no
Description: Set to yes to increase log verbosity.

remoteRsyncBinary

Name: remoteRsyncBinary
Value: full path
Multivalue: no
Default: /usr/bin/rsync
Description: If the rsync program on the remote server is located in non-standard location, set it here

remoteNiceBinary

Name: remoteNiceBinary
Value: full path
Multivalue: no
Default: /bin/nice
Description: If the nice program on the remote server is located in non-standard location, set it here.

localRsyncBinary

Name: localRsyncBinary
Value: full path
Multivalue: no
Default: /usr/bin/rsync
Description: If the local rsync program is located in non-standard location, set it here

localNiceBinary

Name: localNiceBinary
Value: full path
Multivalue: no
Default: /bin/nice
Description: If the nice local program is located in non-standard location, set it here.

RemoteAuthorizedKeysFile

Name: RemoteAuthorizedKeysFile
Value: path relative to remote user's home or full path
Multivalue: no
Default: .ssh/authorized_keys2
Description: If the remote host stores the authorized keys file in a non-standard location, set it here.

Properties for Rsyncd Mode Operation

rsyncdMode

Name: rsyncdMode
Value: yes or no
Multivalue: no
Default: no
Description: Set to yes to connect to the rsync daemon on the remote host (instead of running rsync over ssh).

rsyncdModule

Name: rsyncdModule
Value: string
Multivalue: no
Default: AFFA
Description: The rsyncd module name (only applicable with rsyncdMode=yes).

rsyncdUser

Name: rsyncdUser
Value: string
Multivalue: no
Default: affa
Description: The username for authentication to the rsync daemon (only applicable with rsyncdMode=yes).

rsyncdPassword

Name: rsyncdPassword
Value: string
Multivalue: no
Default: none
Description: The password for authentication to the rsync daemon (only applicable with rsyncdMode=yes).

Properties for global Settings

These properties are allowed only in the [GlobalAffaConfig] section.

globalStatus

Name: globalStatus
Value: enabled, disabled or jobs
Multivalue: no
Default: jobs
Description: Set to enabled or disabled to overide the status settings in all job sections. When set to value jobs, the status settings in the job sections are effictive.

sendStatus

Name: sendStatus
Value: daily, weekly, monthly or never
Multivalue: no
Default: weekly
Description: Defines how frequently the status will be sent.

User comments

Please leave your comments and suggestions on the discussion page.


Personal tools
Namespaces
Variants
Actions
Navigation
Category cloud