athena-backup
Backup management command.
Usage
athena-backup [OPTIONS] COMMAND [ARGS]...
Option | Description |
---|---|
-h, –help | Show built-in help documentation. |
-l, –limit |
Comma separated list of host groups to use in this run. |
-v, –verbose | Enable verbose output. |
Commands
Create
Create service backups.
athena-backup create [OPTIONS] <tags>
Option | Description |
---|---|
-a, –all | Create backups for all services. |
–note |
Backup note. |
–skip-db | Skip creation of database backups. |
Arguments
<tags>
- Comma separated list of service tags to create backups for.
List
List service backups.
athena-backup list [OPTIONS] <tags>
Option | Description |
---|---|
-a, –all | List backups for all services. |
–containers-only | List only container backups. |
-d, –date |
List backups matching date. |
–dbs-only | List only databases backups |
–name |
Match container / db name. |
–note |
Match notes containing text. |
Arguments
<tags>
- Comma separated list of service tags.
Purge
Create backups.
athena-backup purge [OPTIONS] <tags>
Option | Description |
---|---|
-a, –all | Purge all outdated backups. |
-d, –date |
Purge backups matching date |
Arguments
<tags>
- Comma separated list of service tags.
Refresh
Refresh consul backup metadata.
athena-backup refresh
Restore
Restore services from backups.
athena-backup [OPTIONS] restore [ARGS] <tags>
Option | Description |
---|---|
-a, –all | Restore all services. |
-d, –date |
Restore from backup date. |
–skip-db | Skip creation of database backups. |
Arguments
<tags>
- Comma separated list of service tags.
Extending
To add additional backup management operations edit backup.yml
in environment playbook directory.
Examples
To backup freeipa service:
athena-backup create freeipa
To backup all services:
athena-backup create --all
To backup only containers of ‘freeipa’ and ‘redmine’ with a note (‘Test Backup’):
athena-backup create --note "Test Backup" --skip-db freeipa,redmine
To backup Athena images to current environment registry:
athena-backup create images
To list backups for all services:
athena-backup list --all
To list backups for ‘freeipa’ on a given date (‘2017-09-06’):
athena-backup list -d 2017-09-06 freeipa
To purge all outdated backups:
athena-backup purge --all
To purge a specific ‘freeipa’ backups with given date id (‘2017-08-23-07-33-24’):
athena-backup purge -d 2017-08-23-07-33-24 freeipa
To refresh Consul backup metadata:
athena-backup refresh
To restore latest ‘freeipa’ backup:
athena-backup restore freeipa
To restore all services to their latest backups:
athena-backup restore --all
To restore a specific (timestamped 2017-09-04-11-04-12) ‘freeipa’ backup without the database:
athena-backup restore --skip-db -d "2017-09-04-11-04-12" freeipa