1. masuk ke root
sudo su
2. install packet nya
aptitude install automysqlbackup
3. edit scriptnya
nano /etc/default/automysqlbackup
4. scriptnya akan tampil seperti:
[...]
# Host name (or IP address) of MySQL server e.g localhost
DBHOST=localhost
[...]
# List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3"
# The following is a quick hack that will find the names of the databases by
# reading the mysql folder content. Feel free to replace by something else.
#DBNAMES="db_ispconfig web1 web2 web3"
DBNAMES=`find /var/lib/mysql -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f5 | grep -v ^mysql\$ | tr \\\r\\\n ,\ `
[...]
# Backup directory location e.g /backups
# Folders inside this one will be created (daily, weekly, etc.), and the
# subfolders will be database names.
BACKUPDIR="/var/lib/automysqlbackup"
[...]
# Email Address to send mail to? (user@domain.com)
MAILADDR="user@domain.com"
[...]nama database bisa anda ganti hingga lebih dari satu database
selain itu lokasi penyimpanan pun dapat anda ganti
5. jalankan sciptnya dengan perintah
automysqlbackup
oke sekian tutorialnya
Tidak ada komentar:
Posting Komentar