Skip to content

SamanSh999/backup_mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

daily backup mysql all databases

sync backup dir to FTP or S3

for use :

git clone https://github.com/SamanSh999/backup_mysql.git

copy example env and set your database and ftp user password

cp env.example.sh env.sh 

vim env.sh 

and final

./mysql.sh

requirement for Ubuntu/Debian

sudo apt install lftp # if you want backup in ftp server
sudo apt install awscli # if you want backup in s3 storage

set crontab to daily backups

CRON:

  • example cron for daily batabase backup at 1:09 am
  • min hr mday month wday command
crontab -e

and insert end of line

09   1  *    *     *    /dir-you-clone-repo/mysql.sh

for restore backup :

gunzip < [backupfile.sql.gz] | mysql -u [uname] -p[pass] [dbname]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages