How To remote backup with rsync
This is probably the simply way to backup data to other server using a secure protocoal an minimum bandwidh.
Note:
BackupServer.com – Is the backup server
MainServer.com – Is the server you want to backup
- Login to the server you want to backup
- Creating a key with the ssh-keygen utility:
ssh-keygen -t rsa -N '' (these are two single quotes) - Copy RSA encryption key to the backup server:
scp ~/.ssh/id_rsa.pub username@backupserver.com:keys/server1
ssh username@backupserver.com mergekeys
Shell Script To Dump All MySQL Databases Every Hour To NAS Storage
+ Download this script
+ Modify settings according to your setup
+ Install cron job as follows to run script every hour
# Backup database every 1 hr to folder /nas/mysql
@hourly /root/scripts/db1hr.backup.sh >/dev/null 2>&1
Sample Shell Script To Dump All MySQL Databases
Read more…
Backup a database using phpMyadmin
Backup of Mysql database
It is assumed that you have phpMyAdmin installed since a lot of web service providers use it.
- Open phpMyAdmin.
- Click Export in the Menu to get to where you can backup you MySql database. Image showing the export menu.
- Make sure that you have selected to export your entire database, and not just one table. There should be as many tables in the export list as showing under the database name.
- Selectâ€SQLâ€-> for output format, Check “Structure†and “Add AUTO_INCREMENT†value. Check “Enclose table and field name with backquotesâ€. Check “DATAâ€, check use “hexadecimal for binary fieldâ€. Export type set to “INSERTâ€.
- Check “Save as fileâ€, do not change the file name, use compression if you want. Then click “GO†to download the backup file.
MySQL Dump and Restore
Dump ALL MySQL Databases:
mysqldump –-user=XXXXXXXX -–password=XXXXXXX -A > /PATH/TO/DUMPFILE.SQL
Dump Individual or Multiple MySQL Databases:
mysqldump -–user=XXXXXXXX -–password=XXXXXXX DB_NAME1 DB_NAME2 DB_NAME3 > /PATH/TO/DUMPFILE.SQL
Read more…