Skip to content

Using cron, schedule automated MySQL database backups to git

License

Notifications You must be signed in to change notification settings

pycal/MySQL-to-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

MySQL-to-git

Using cron, schedule automated MySQL database backups to git

I like this approach because I don't have to cleanup or version files on my system

One caveat: if you're using github or bitbucket, this approach is probably only appropriate for databases < 50mb

Instructions

  1. Create repo on github or bitbucket
  2. cd /dir/outside/webroot
  3. git clone [email protected]:user/new_repo.git
  4. export BACKUP_DIR=/dir/outside/webroot/new_repo
  5. Define environment variables for DB_USER, DB_PW, DB_NAME
  6. Save file and add to crontab
  7. chmod 600 git-db-backup.sh

About

Using cron, schedule automated MySQL database backups to git

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages