Package: dbackups
OverviewThe purpose of this tool is to make backing up databases in bulk easy to do. This service runs database actions based on a config file. No implementation details are needed to backup you common databases.Currently supports the following Databases for backup:PostGreSQLMySQLInstallationSupported Platforms:LinuxSetup Requirements:setuptools_gitRequirements:Python 2.7requestsInstall usingvirtualenvandpip.mkdir -p ~/.venvs
virtualenv ~/.venvs/dbackups
source ~/.venvs/dbackups/bin/activate
pip install dbackupsInstall usingpip.pip install dbackupsConfigureThe purpose of this package is that now backing up multiple databases within an infrastructure. You can also specify
where to upload the backups.Config File:This uses python`os.path.expanduser('~')`and translates to the following:vim ~/.dbackups/databases.iniAdd each or your databases as a section of the config file. Defining the connection and upload options.### Example[example-db]
# if you want to enable the backup for this database
enabled = True
# the type of database
db_type = postgresql
# connection parameters for the DB
db_host = host_of_database
db_name = user
db_user = postgres
db_pass = password123
db_port = 5432# these are passed into a requests.put method (futures will improve this section)
upload_url =https://backups.example.com/backups/upload_user = backupuser
upload_pass = password543RunningCurrently the one way to run the job of backing up the configured Databases from the config file is to run the
commanddbackupscronThis will try to dump and upload all enabled databases in the config file. This is meant as a first step towards havingpython schedule its own cron and run as a systemd/init service.### Cron Script
Create a similar cron script in/etc/cron.daily/sudo vim /etc/cron.daily/dbackups.cron
sudo chmod +x /etc/cron.daily/dbackups.cronContents:#!/usr/bash
source ~/.venvs/dbackups/bin/activate && dbackupscron## LoggingLogging for this application today is done by a config file. this can be found in theconfigdirectory under the
project root.
This file gets used by all of the binaries distributed by this application.By default the logs can be found in the program directory:~/.dbackups/logs/Thedbackupscronscript has its own log allowing easy triage of the cron script~/.dbackups/logs/database_backup_cron.log## FuturesWindows supportScript to enter new configuration entries to the database.iniAdd feature to clone one database to another for Development purposesAdd cleanup for the dump files. (relying on temp dir cleanup today)A simple UI to see uploaded backups, and configure database entries.## DataBase Troubleshooting[MySQL](docs/mysql.md)[PostGreSQL](docs/postgres.md)## Reporting issuesAs a start please log issues or they might never be fixed!As a guild the following is a checklist of things to check and provide in your issue.What OS are you running?Please attach the [logs](##Logging)Can you reproduce?What steps did you take to get the issue?## Documentation IssuesFor issues with the documentation or enhancements desired please log an issue with what page the issue is on and all the details about why it is not correct or clarification needed in any part of the docs.