Package: bashckup
BashbackupIt is a python application that allows you to easily describe the backup steps you want. It is possible to describe the
steps in YAML or in CLI. The tool also allows to manage the restoration based on the backup steps.InstallationpipinstallbashckupExamplesBackup with YAML filebashckupbackupfile--config-file/home/bashckup/config.ymlRestoration with YAML filebashckuprestorefile--config-file/home/bashckup/config.ymlConfig file:Show up----name:Backup MariaDB databaseid:backup-maria-db2reader:mariaDBDatabase:args:database-name:"myDatabase"transformers:-gzip-crypt:args:password-file:password-safe.txtwriter:outputFile:args:path:./file-name:output.sql.gz-name:Backup website folderid:backup-websitereader:files:args:path:backupFolder/incremental-metadata-file-prefix:tar-snaplevel-0-frequency:'weekly'transformers:-gzip:args:level:9writer:outputFile:args:path:./file-name:backup.tar.gzpost-backup:-rsync:args:ip-addr:10.8.0.1dest-module:testdest-folder:bckuser:user-cleanFolder:args:retention:31Backup with CLI inputsbashckupbackupcli--reader-modulemariaDBDatabase--reader-argsdatabase-name='myDatabase'--transformer-modulegzip--transformer-argsnop--transformer-modulecrypt--transformer-argspassword-file=password-safe.txt--writer-moduleoutputFile--writer-argspath='.'file-name='output.sql.gz'restoration with CLI inputsbashckuprestorecli--reader-modulemariaDBDatabase--reader-argsdatabase-name='myDatabase'--transformer-modulegzip--transformer-argsnop--transformer-modulecrypt--transformer-argspassword-file=password-safe.txt--writer-moduleoutputFile--writer-argspath='.'file-name='output.sql.gz'ConceptBackupLogical architectureContext is share between all actuators (Reader/Transformer/Writer/Post backup).
This makes it possible to adapt the behavior of an actuator to the others without direct dependence (e.g.: 'cleanFolder' can retrieve the output folder defined by 'fileWriter')Table of contentTODOModulesReaderTransformerWriterPost backupfilesgzipoutputFilecleanFoldermariaDBDatabasecrypt-rsyncReadersFile readerUsetarbash command and allows to save files from file systemsConfigurationParameter nameDescriptionRequiredDefault valuepathFolder path for the backup. It will create a sub-folder with the backup idTrue-incremental-metadata-file-prefixName of metadata-file used to store difference between backupsFalse-level-0-frequencyWhen a full backup have to be done ? You have to choose in ['weekly', 'monthly']FalseweeklyRestoration⚠️If you make a differential backup, the restoration cannot yet be done by bashckup⚠️
It renames the name of the folder defined by 'path' (adds '-bck') to keep the files present on the server.
If the restoration fails you can go back by removing the '-bck' added to the folder nameMariaDB database⚠️You have to be root to use it, no authentication method is available yet⚠️Usemysqldumpbash command and allows to generate a backup based on SQL instructions.ConfigurationParameter nameDescriptionRequiredDefault valuedatabase-nameName of mariadb databaseTrue-Restoration⚠️It deletes the old database, if the restoration fails it is not possible to go back⚠️TransformersGzipUsegzipbash command and allows to compress.ConfigurationParameter nameDescriptionRequiredDefault valuelevelRegulate the speed of compression using the specified digit #, where 1 indicates the fastest compression method (less compression) and 9 indicates the slowest compression method (best compression). The default compression level is 6 (that is, biased towards high compression at expense of speed).False6CryptUseopensslbash command and allows to do symmetric encryption.ConfigurationParameter nameDescriptionRequiredDefault valuepassword-filePath to the file that contains the passwordFalse-WriterOutput fileUsecatbash command and allows to save backup on fil systems.ConfigurationParameter nameDescriptionRequiredDefault valuepathPath to the output folderTrue-file-nameFile name of the backup fileTrue-Post backupClean folderRemove outdated backupsConfigurationParameter nameDescriptionRequiredDefault valueretentionRetention duration in daysTrue-Rsync⚠️You have to usepassword-fileifuserneeds a password to login, otherwise backup will be stuck waiting password
from stdin⚠️⚠️Rsync is configured as mirror (delete files presents in dest but not presents in src)⚠️Usersyncbash command and allows to push backups's folder to a remote location.password-filemust point to a file that must be owned by the user running "bashckup", and it must be accessible only
by him (chmod 600)ConfigurationParameter nameDescriptionRequiredDefault valueip-addrIP address of remote hostTrue-dest-moduleDestination rsyncd moduleFalse-dest-folderDestination folderTrue-userUsername to use to log inTrue-password-filePath to the file that contains the passwordFalse-