Backup Otomatis Data MySQL

Buat file backup mysql dengan ekstensi .sh
# vi backup_mysql.sh

Isi file:
#! /bin/sh
mysqldump -u root -ppassword_mysql nama database | gzip > $(date +%Y%m%d)_database.sql.gz

Agar sistem secara otomatis menjalankan skrip tersebut maka saya tambahkan di crontab:
# crontab -e

Tambahkan baris berikut:
15 8 * * * /root/backup_mysql.sh

Share on Google Plus

About Admin

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.

0 comments: