Backup¶
Warning
Backup is one of the reason why mature structures should switch to managed services, in order to ease the manual work and benefit from the long experience of the hyperscalers. As often the solution presented here should only be used by individuals/small SME/startups in their infancies.
The backup.md
module of ecodev-core has only one backup
method (an original name 😁).
backup
¶
backup
eats
- a pathlib Path
backed_folder
corresponding to a folder one wants to backup - (Optional) a
nb_saves
int (default value 5) corresponding to the maximum number of backups to keep.
The backup
method also uses some environment variables, meant to connect to a ftp server
backup_username
: the username to connect to the backup serverbackup_password
: the password associated tobackup_username
backup_url
: the backup server url address
backup
will backup both backed_folder
and the db on which the application running the backup is plugged (thanks to pg_dump
.
It will connect to the backup server thanks to lftp.