#!/bin/bash
#backup bases de donnée mysql
chemin="[path]/backups"
file="$chemin/$(date +'%Y%m%d')dbName.sql"
touch $file

mysqldump -u[usr] -p[passwd] dbName > $file
gzip $file
cd $chemin
#erase file older than 50 days
find . -mtime +50 -exec rm {} \;
  • info/mysqlsimplebackup.sh.txt
  • Dernière modification: 2018/07/18 09:46
  • par radeff