Guest User

Untitled

a guest
Jan 23rd, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/sh
  2. #change directory to your backup directory
  3. cd /home/xxx/backup_dbs/;
  4. #get backup of database of applications
  5. mysqldump --user='myuser' --password='mypw' mydb >tmp_db.sql;
  6. #compress it in zip file
  7. zip app_database-$(date +%Y-%m-%d-%H:%M).sql.zip tmp_db.sql;
  8. #remove sql file
  9. rm -rf tmp_db.sql;
  10. #delete backups older than 20 days
  11. find /home/xxx/backup_dbs/app* -mtime +20 -type f -delete;
  12.  
  13. /home/xxx/backup_dbs/backup.sh
Add Comment
Please, Sign In to add comment