Affa Command Line Options

From Nikoforge Wiki
Jump to: navigation, search
Note-icon.gif Note:
Options can be abbreviated to uniqueness, e.g. 'affa --lo' is equal to 'affa --log-tail'

Contents

--run

affa --run JOB

Starts a job run. Usually done by the cronjob.

--configcheck

Checks the syntax and values in all configuration files found in /etc/affa/. Run this command after modifying the configuration. Lower/Upper case errors in property names are corrected automatically.

--make-cronjobs

affa --make-cronjobs

Configures the cronjobs. Run this command to make changes of time related properties effective i.e. TimeSchedule, killAt and resumekKilledAt properties. Every 15 minutes Affa checks whether a configuration file is newer than the cronjob file and runs the make-cronjobs command if this is the case.

--send-key

affa --send-key [JOB JOB ...]

This first generates the DSA key on the Affa Server, if not already done. Then the public key is send to the hosts 'remoteHostName' as defined in section of each job JOB and generates the job specific ssh known host entry.

Note-icon.gif Note:
When initially doing this step, you will need to temporarily enable "Allow secure shell access using standard passwords" on the source server.

--check-connections

affa --check-connections [JOB JOB ...]

Checks the ssh login and if applicable rsyncd auth for all jobs given as arguments. Without any arguments all jobs are checked.

--full-restore

affa --full-restore  [--preserve-newer=no] [--delete=yes] JOB [ARCHIVE]

Does a full restore remote server of all backed up files and directories from the backup ARCHIVE. If ARCHIVE is not given, the archive 'scheduled.0' is used as the default. The full restore reconstructs the server as it was at the time of the backup. After the restore the source host reboots.

With option --preserve-newer=yes files on the remote server with modification time newer than on the backup are not overwritten.

With option --delete=yes all files on the remote server, which are not in the backup, are deleted

--list-archives

affa --list-archives [--csv] JOB

Displays a table of all present archives of job JOB with date, number of files, size and and bytes received. While column buTime shows the actual rsync time, the column ddTime shows the length of the subsequent deduplication run. ddYld is the gained deduplication yield in bytes.

Affa version 3.1.0-0 on affa-2.mydomain.com
+------------------------------------------------------------------------------+
| Job: fshare-ak                                                               |
| Description: Fileserver AK                                                   |
| Directory: /var/affa/fshare-ak/                                              |
| Hostname: 10.204.104.4                                                       |
| Email: sysadmin@mydomain.com                                                 |
+-----+----------------------+--------+--------+-------+-------+-------+-------+
| Run | Completion date      | buTime | ddTime | ddYld | Files |  Size | Recvd |
+-----+----------------------+--------+--------+-------+-------+-------+-------+
| Y 0 | Wed 2010-06-23 20:26 | 11m53s |      - |     - |  412k |  143G |  470M |
+-----+----------------------+--------+--------+-------+-------+-------+-------+
| M11 | Sun 2010-08-29 20:22 |  7m50s |      - |     - |  417k |  153G |   14M |
| M10 | Sun 2010-09-26 20:23 |  8m57s |      - |     - |  430k |  156G |   14M |
| M 9 | Sun 2010-10-31 20:25 | 10m05s |      - |     - |  448k |  161G |   15M |
| M 8 | Sun 2010-11-28 20:31 | 16m42s |      - |     - |  463k |  167G |   17M |
| M 7 | Sun 2011-01-02 20:48 | 33m07s |      - |     - |  486k |  173G |  1.1G |
| M 6 | Sun 2011-01-30 20:33 | 18m54s |      - |     - |  493k |  176G |   24M |
| M 5 | Sun 2011-02-27 20:28 | 13m31s |      - |     - |  490k |  176G |   19M |
| M 4 | Sun 2011-03-27 20:28 | 13m08s |      - |     - |  491k |  175G |   17M |
| M 3 | Sun 2011-05-01 20:30 | 15m41s |      - |     - |  493k |  179G |   18M |
| M 2 | Sun 2011-05-29 20:28 | 13m40s |      - |     - |  494k |  182G |   31M |
| M 1 | Sun 2011-06-19 20:26 | 11m20s |      - |     - |  493k |  183G |   17M |
| M 0 | Sun 2011-07-03 20:28 | 13m46s |      - |     - |  496k |  183G |   18M |
+-----+----------------------+--------+--------+-------+-------+-------+-------+
| W 3 | Sun 2011-07-10 20:28 | 13m38s |      - |     - |  479k |  180G |   16M |
| W 2 | Mon 2011-07-11 20:35 | 20m27s |      - |     - |  479k |  180G |  301M |
| W 1 | Fri 2011-07-15 20:30 | 15m53s |      - |     - |  480k |  180G |   62M |
| W 0 | Sun 2011-07-24 19:39 |  9m25s |      - |     - |  482k |  181G |   16M |
+-----+----------------------+--------+--------+-------+-------+-------+-------+
| D 6 | Thu 2011-07-28 19:42 | 12m22s |      - |     - |  483k |  182G |  176M |
| D 5 | Fri 2011-07-29 23:29 | 11m10s |  5h33m |   45G |  483k |  182G |   16M |
| D 4 | Sat 2011-07-30 19:53 | 23m26s |  2h30m |  8.3G |  483k |  182G |   17M |
| D 3 | Sun 2011-07-31 20:07 | 37m31s |  4m47s |  8.3G |  483k |  182G |   17M |
| D 2 | Mon 2011-08-01 20:44 |  1h14m |  7h50m |  8.5G |  484k |  182G |  630M |
| D 1 | Tue 2011-08-02 20:02 | 32m28s | 12h20m |  8.3G |  484k |  182G |   74M |
| D 0 | Wed 2011-08-03 19:58 | 28m46s | 11h01m |  8.5G |  484k |  182G |  214M |
+-----+----------------------+--------+--------+-------+-------+-------+-------+
| S 0 | Thu 2011-08-04 20:00 | 30m28s | 11h52m |  8.5G |  484k |  182G |  203M |
+-----+----------------------+--------+--------+-------+-------+-------+-------+

With --csv, the output is in machine readable colon separated format.

--status

affa --status [--csv]

Displays a table of all configured jobs with enable status, time of last and next run, size of the most recent archive, exectution time of the last run and the number of scheduled (S), daily (D), weekly (W), monthly (M) and yearly (Y) archives. If last time shows 'failed', the job did not run in the last 24h. For disabled jobs 'Last' always shows 'failed' after 24 h. To see the date and time of the last run of those jobs use the --list-archives option. Column 'Next' shows the time when the next run will be started, if 'Enabled' is 'yes'. Column 'ddYld' shows the deduplication yield in bytes.

Affa version 3.1.0-0 on affa-2.mydomain.com
+--------------+-----+-------+--------+-------+-------+-------+----------------+
| Job          | ENA |  Last |   Time |  Next |  Size | ddYld | N of S,D,W,M,Y |
+--------------+-----+-------+--------+-------+-------+-------+----------------+
| ads-ak       | yes | 20:20 |  0m29s | 20:20 |   28M |     - |  1, 7, 2, 0, 0 |
| ak-user-ma.. | yes | 22:31 |  1m51s | 22:30 |  170M |     - |  3, 7, 4, 6, 0 |
| azubi-1      | yes | 03:39 |  3h24m | 00:15 |   44G |  1.2G |  1, 7, 4,10, 1 |
| dcpant       | yes | 03:06 |  1m03s | 03:05 |  1.3G |     - |  1, 7, 4,10, 1 |
| eshare       | yes | 21:06 | 21m01s | 20:45 |   24G |  178M |  1, 7, 4,10, 1 |
| etherpad     | yes | 20:40 |  0m13s | 20:40 |  3.1M |     - |  1, 7, 4, 2, 0 |
| fazubi       | yes | 08:16 | 11h16m | 21:00 |  132G |  3.3G |  1, 7, 4,10, 1 |
| fschare-rh   | yes | de-duplicating (pid 9719)              |  1, 7, 4,10, 1 |
| fsh-02       | yes | 07:53 | 12h23m | 19:30 |  182G |  8.5G |  1, 7, 4,10, 1 |
| fshare-ak2   | yes | 00:30 |  0m26s | 00:30 |  415M |  544k |  1, 7, 4,10, 1 |
| helpdesk     | yes | 21:27 |  2m16s | 21:25 |  895M |  138k |  1, 7, 4,10, 0 |
| it-share     | yes | running rsync (pid 9744)               |  1, 7, 1, 0, 0 |
| lightroom    | yes | waiting (pid 9528)                     |  1, 7, 4, 2, 0 |
| localhost    | yes | 02:15 |  0m08s | 02:15 |  395k |     - |  1, 7, 2, 0, 0 |
| mediawiki    | yes | 16:10 |  0m06s | 19:40 |  1.1G |  6.7M |  3, 7, 4,10, 1 |
| mshare       | yes | 00:48 |  1h33m | 23:15 |   18G |  2.4G |  1, 7, 4,10, 1 |
| wshare       | yes | 00:34 |  1h49m | 22:45 |   23G |  484M |  1, 7, 4,10, 1 |
+--------------+-----+-------+--------+-------+-------+-------+----------------+
2 disabled jobs not listed. Use --all to display.

With --csv, the output is printed in a machine readable colon separated format.

--show-config-pathes

affa --show-config-pathes [--csv] [JOB JOB ...]

Prints the full pathes of the file where the section of job JOB is defined.

--show-default-config

affa --show-default-config

Prints a list of all allowed property names with their default values. These values are used, when omitted in the job sections.

--show-schedule

affa --show-schedule [--all]

Prints a 'graphical' timetable for all enabled jobs. The resolution is 30 minutes. An 'S' character marks the scheduled start times. The duration of the job runs are marked with '=' characters.

Affa version 3.1.0-0 on affa-2.mydomain.com
              TIME 12:00    16:00    20:00    0:00     4:00     8:00
            fsh-02 -------- -------S ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ --------
            ads-ak -------- -------- S------- -------- -------- --------
          etherpad -------- -------- -S------ -------- -------- --------
            eshare -------- -------- -S~----- -------- -------- --------
            fazubi -------- -------- --S~~~~~ ~~~~~~~~ ~~~~~~~~ ~-------
          helpdesk -------- -------- --S----- -------- -------- --------
          it-share -------- -------- ---S=~~~ ~~~~~~~~ ~~~~~~~- -------- busy
            wshare -------- -------- -----S~~ ~~------ -------- --------
ak-user-management -------- -------- -----S-- -------- -------- --------
        fschare-rh -------- -------- -----S=- -------- --~----- -------- busy
            mshare -------- -------- ------S= ~~------ -------- --------
           azubi-1 -------- -------- -------- S=~~~~~~ -------- --------
        fshare-ak2 -------- -------- -------- -S------ -------- --------
         mediawiki -------- -------- -------- ---S---- -------- ----S---
         localhost -------- -------- -------- ----S--- -------- --------
            dcpant -------- -------- -------- ------S- -------- --------
         lightroom -------- -------- -------- -------- -------- S------- busy
Symbols: S=scheduled K=kill R=resume '='=rsync '~'=dedup
2 disabled jobs not listed. Use --all to display.

--log-tail

affa --log-tail [JOB]

Displays the tail of the logfile of job JOB with live update. This command is identical to tail -n 50 -f /path/to/logfile. Without the JOB argument the global logfile is shown.

--send-status

affa --send-status

Sends the status table, the disk-usage and the archive list of all jobs to the email addresses configured in the [GlobalAffaConfig] section.

--disk-usage

affa --disk-usage

Shows the current disk usage of all root dir filesystems

Affa version 3.1.0-0 on affa-2.mydomain.de
+------+--------+--------+----------------------------------------------------+
| Use% |   Used |  Avail | Root Dir                                           |
+------+--------+--------+----------------------------------------------------+
|  71% |  938GB |  365GB | /var/affa                                          |
|  20% |  194GB |  759GB | /mnt/affadev                                       |
+------+--------+--------+----------------------------------------------------+

With --csv, the output is printed in a machine readable colon separated format.

--cleanup

affa --cleanup JOB

After you have lowered a keep value, e.g. scheduledKeep, then archives with a higher indices will no longer be shifted and will exist for ever. This option finds these archives and deletes them after confirmation.

--rename-job

affa --rename-job JOB NEWNAME

Renames the job JOB to NEWNAME including the section name and archive directories.

--move-archive

affa --move-archive JOB NEWROOTDIR

Moves the archive directory of job JOB to the rootdir NEWROOTDIR and adjusts the value of property RootDir. NEWROOTDIR must be a full path starting with a slash. As moving across filesystems (e.g. from an external USB drive to the local disk) is not possible, Affa uses a copy command in this case and deletes the source directory after that. Depending on the archive size, copying across filesystems can take a long time.

--delete-job

affa --delete-job [--revoke-key] JOB

Irreversibly deletes all archives, of job JOB and set the status property to disable. With --revoke-key option, the public key on the remote server will be deleted.

--revoke-key

affa --revoke-key JOB

Deletes the public dsa key on the remote server.

--kill

affa --kill JOB

Terminates the running job JOB and all its child processes (rsync processes).

--killall

affa --killall

Terminates all running jobs.

--mailtest

affa --mailtest JOB

Sends a test email to the email addresses configured in the JOB section. Use this to verify, that your mail system is working.
Note: By default Affa only sends messages on errors, never on success (see property chattyOnSuccess).

--nrpe

affa --nrpe [JOB JOB ...]

Checks for jobs that were not run the last NRPRtrigger hours and reports them as failed. A Nagios/ICINGA NRPE complient message is printed and exit status returned.

--version

affa --version

Displays the Affa version number and checks Samba and Freedup installation.

--warranty

affa --warranty

Displays the disclaimer of liability.

--license

Displays the license Affa is released under.

--help

Displays a short help.

--debug

affa --debug

Enables verbose logging. Overrides job and global configurations.

User comments

Please leave your comments and suggestions on the discussion page.


Personal tools
Namespaces
Variants
Actions
Navigation
Category cloud