How can I create a MySql Job that runs daily to generate a database backup and stores in on the server?
Also How can I create a second Job that does a maintenance on the database to keep it running without problem?
Thanks
How can I create a MySql Job that runs daily to generate a database backup and stores in on the server?
Also How can I create a second Job that does a maintenance on the database to keep it running without problem?
Thanks
one possible way is run the following as daily cron.
mysqldump -u <db_user> -p <db_password> <db_name> -h <db_host_if_any> > /home/backups/backup_<timestamp>.sql
gzip it and store it(just a mechanism to reduce size)
gzip /home/backup/backup_<timestamp>.sql