diffusionkinetics / open

DiffusionKinetics open-source monorepo
MIT License
115 stars 24 forks source link

Dampf: backup destination #74

Open glutamate opened 6 years ago

glutamate commented 6 years ago

The backup command should take an optional text argument indicating the destination of the backup file. Some possibilities:

dampf backup - output to stdout dampf backup foo output file named foo dampf backup scp://user@host:/path/to/file copy using scp dampf backup ftp://user@host:/path/to/file copy using ftp

The destination should accept time %-code formatting which should be substituted in the final destination string. This is to facilitate for instance weekly rotating backups. An additional %-code for the database name (%_DB) should be accepted.

Note this clashes with the current commandline argument which is optionally specifying the database name. Can we add this instead as a named flag.

dampf backup --database mydb foo.sqlc - backup the mydb database to foo.sqlc dampf backup foo - backup all databases to file named foo. If there is more than one database, concatenate them into a tar archive

If no destination is specified, a default destination from the configuration file (with a key like default_backup_destination) should be used.

The configuration file should have an optional key encrypt_backup_password. If this is present, any backup will be encrypted with symmetric gpg encryption before being sent to the destination.

glutamate commented 6 years ago

This is not so important because all of this functionality can be implemented with a simple bash script