Backup:
mysqldump -u [username] -p [password] [databasename] > /home/shares/backup_db.sql
 
Restore:
mysql -u root -p sexcenter < /home/www/sexcenter/dump/g2_Entity_Original.sql
 
setup Cron Job:
# crontab -e
———-
@midnight /usr/bin/mysqldump –user=root –password=horse78 –all-databases > /home/alldatabases.sql