All Projects → maurodelazeri → mysql-backup-golang

maurodelazeri / mysql-backup-golang

Licence: Apache-2.0 license
Mysql backup golang

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to mysql-backup-golang

Clickhouse Backup
Tool for easy ClickHouse backup and restore with cloud storages support
Stars: ✭ 359 (+1336%)
Mutual labels:  backup, dump
laravel-database-manager
Make your database simple, easier and faster with vuejs.
Stars: ✭ 50 (+100%)
Mutual labels:  backup, dump
Telegram Cli Backup
A simple Lua script to backup Telegram messages into a CSV or sqlite database
Stars: ✭ 101 (+304%)
Mutual labels:  backup, dump
yii2-db-manager
Database Backup and Restore functionality
Stars: ✭ 96 (+284%)
Mutual labels:  backup, dump
Wikiteam
Tools for downloading and preserving wikis. We archive wikis, from Wikipedia to tiniest wikis. As of 2020, WikiTeam has preserved more than 250,000 wikis.
Stars: ✭ 404 (+1516%)
Mutual labels:  backup, dump
Backup
MySQL Database backup package for Laravel
Stars: ✭ 66 (+164%)
Mutual labels:  backup, dump
Dumpling
Dumpling is a fast, easy-to-use tool written by Go for dumping data from the database(MySQL, TiDB...) to local/cloud(S3, GCP...) in multifarious formats(SQL, CSV...).
Stars: ✭ 134 (+436%)
Mutual labels:  backup, dump
Zfsbackup Go
Backup ZFS snapshots to cloud storage such as Google, Amazon, Azure, etc. Built with the enterprise in mind.
Stars: ✭ 179 (+616%)
Mutual labels:  backup
Rsync Time Backup
Time Machine style backup with rsync.
Stars: ✭ 2,572 (+10188%)
Mutual labels:  backup
Mysql Dump
MySQL Dump Utility
Stars: ✭ 178 (+612%)
Mutual labels:  backup
Rsnapshot
a tool for backing up your data using rsync (if you want to get help, use https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss)
Stars: ✭ 2,335 (+9240%)
Mutual labels:  backup
Git S3 Push
Deploy your git repo to an S3 bucket
Stars: ✭ 182 (+628%)
Mutual labels:  backup
Tumblthree
A Tumblr Backup Application
Stars: ✭ 211 (+744%)
Mutual labels:  backup
Weresync
Clones Linux hard drives incrementally or to a smaller drive
Stars: ✭ 180 (+620%)
Mutual labels:  backup
Docker Gphotos Sync
A Docker image for synchronizing your original-quality Google Photos
Stars: ✭ 241 (+864%)
Mutual labels:  backup
Gitlabber
Gitlabber - clones or pulls entire groups tree from gitlab
Stars: ✭ 176 (+604%)
Mutual labels:  backup
Go Mydumper
A multi-threaded MySQL backup and restore tool, faster than mysqldump
Stars: ✭ 250 (+900%)
Mutual labels:  backup
Photos
[DEPRECATED] Encrypted, secure, decentralized personal data wallet -- technology behind textile.photos
Stars: ✭ 236 (+844%)
Mutual labels:  backup
Dmarchiver
A tool to archive the direct messages, images and videos from your private conversations on Twitter
Stars: ✭ 204 (+716%)
Mutual labels:  backup
Pg rman
Backup and restore management tool for PostgreSQL
Stars: ✭ 197 (+688%)
Mutual labels:  backup

Mars

Overview

Mars is a tool for backing up multiple MySQL databases with multiples options. The backups are outputted as a .tar.gz and are stored locally, there is also support for retention in days/weeks/months

Usage

$ go run mars.go -help
  -hostname string
    	Hostname of the mysql server to connect to (default "localhost")
  -bind string
    	Port of the mysql server to connect to (default "3306")
  -password string
    	password of the mysql server to connect to (default "1234")
  -username string
    	username of the mysql server to connect to (default "root")
  -additionals string
    	Additional parameters that will be appended to mysqldump command
  -tablethreshold int
    	Do not split mysqldumps, if rowcount of table is less than dbthreshold value for table (default 5000000)      
  -batchsize int
    	Split mysqldumps in order to get each file contains batchsize number of records (default 1000000)
  -databases string
    	List of databases as comma seperated values to dump. OBS: If not specified, --all-databases is the default (default "--all-databases")
  -dbthreshold int
    	Do not split mysqldumps, if total rowcount of tables in database is less than dbthreshold value for whole database (default 10000000)
  -excluded-databases string
    	List of databases excluded to be excluded. OBS: Only valid if -databases is not specified
  -forcesplit
    	Split schema and data dumps even if total rowcount of tables in database is less than dbthreshold value. if false one dump file will be created
  -mysqldump-path string
    	Absolute path for mysqldump executable. (default "/usr/bin/mysqldump")
  -output-dir string
    	Default is the value of os.Getwd(). The backup files will be placed to output-dir {DATE/{DATABASE_NAME}/{DATABASE_NAME}_{TABLENAME|SCHEMA|DATA|ALL}_{TIMESTAMP}.sql
  -daily-rotation int
    	Number of days of retention (default 5)   	
  -weekly-rotation int
    	Number of weeks of retention (default 2)
  -monthly-rotation int
    	Number of months of retention (default 1) 
  -verbosity int
    	0 = only errors, 1 = important things, 2 = all (default 2)      
  -test
    	test

Rotation folders structure

mysqldump-path / daily|weekly|monthly / XXXX-XX-XX / {DATABASE_NAME}-XXXX-XX-XX / {DATABASE_NAME}{TABLENAME|SCHEMA|DATA|ALL}{TIMESTAMP}.tar.gz

Example

Running a backup of only one database:

$go run mars.go -username "root" -password "123456" -databases "mysql"

Running with parameters
{
	"HostName": "localhost",
	"Bind": "3306",
	"UserName": "root",
	"Password": "123456",
	"Databases": [
		"mysql"
	],
	"ExcludedDatabases": [],
	"DatabaseRowCountTreshold": 10000000,
	"TableRowCountTreshold": 5000000,
	"BatchSize": 1000000,
	"ForceSplit": false,
	"AdditionalMySQLDumpArgs": "",
	"Verbosity": 2,
	"MySQLDumpPath": "/usr/bin/mysqldump",
	"OutputDirectory": "/home/mauro/Downloads/mysql-dump-goland",
	"DefaultsProvidedByUser": true,
	"ExecutionStartDate": "2017-08-05T22:39:26.473773337-04:00",
	"DailyRotation": 5,
	"WeeklyRotation": 2,
	"MonthlyRotation": 1,
}
Running on operating system : linux
Processing Database : mysql
Getting tables for database : mysql
30 tables retrived : mysql
options.ForceSplit (false) && totalRowCount (2102) <= options.DatabaseRowCountTreshold (10000000)
Generating single file backup : mysql
mysqldump is being executed with parameters : -hlocalhost -uroot -p1234 -r/home/mauro/Downloads/mysql-dump-goland/daily/2017-08-05/mysql-2017-08-05/mysql_ALL_20170805.sql mysql
mysqldump output is : 
Compressing table file : /home/mauro/Downloads/mysql-dump-goland/daily/2017-08-05/mysql-2017-08-05/mysql_ALL_20170805.sql
Single file backup successfull : mysql
Processing done for database : mysql
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].