Skip to content

Simple script creates a backup of every MySQL database and compresses it.

License

Notifications You must be signed in to change notification settings

Roskus/mysql-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MySQL Backup

This simple script creates a backup of every MySQL database and compresses it.

  • Load password from config file
  • Export functions and triggers in .sql files
  • Compress backups with gzip
  • Database exception list
  • Organized backups folder by date backup/YYYY/MM/DD/

Run

php backup-db.php

Contab configuration

Run every day at 12 am

* 0 0 * * * cd /var/www/cron/ && php backup-db.php

Setup

  • Clone the repository
  • Add execution permision
chmod +x backup-db.php
  • Copy .dist files:
cp config.php.dist config.php
cp mysql.conf.dist mysql.conf
  • Set your user and password in config files.
  • Add crontab configuration:
crontab -e

About

Simple script creates a backup of every MySQL database and compresses it.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages