![]() In the “Select databases” section, you can select the databases that you want to back up. This can be done by clicking “Add new job” and then “Create job.” Then you should add a connection to the MySQL database sudo sqlbak -add-connection -db-type=mysql -user=root The installation of the SqlBak app on Linux is very simple, more details on how to do it can be found here.Īfter registration, your server will appear on the Dashboard page. You can find the package installation and registration instructions for your OS here. You can install the app using the standard package managers that come with your operating system. This service allows you to create not only MySQL backups, but also ones for PostgreSQLĪnd MS SQL Server databases. The process of creating a backup in SqlBak may include not only creating, compressing, encrypting, and sending data to cloud storage locations, but also sending notifications and running a restore to another computer. This is a service that provides you with a wide range of options to automatically back up your MySQL database. No integrated solution for removing old backups.You may only specify a folder as the backup storage location.In order to facilitate this, do as follows: sudo crontab -e Sudo mysqldump -u $user -p$password -all-databases > $sqlfileĮcho 'mysqldump return non-zero code' | mailx -s 'No backup was created!' $recipient_emailĮcho 'The backup was successfully compressed'Įcho 'Error compressing backup' | mailx -s 'Backup was not created!' $recipient_emailĮcho $zipfile | mailx -s 'Backup was successfully created' $recipient_emailįind $backupfolder -mtime +$keep_day -deleteĬron allows you to schedule this script to run regularly. At the beginning of the script, we specify the backup storage directory, the notification email address, and the backup storage period. The following is the simplest implementation of a bash script for performing regular backups. In Ubuntu we can do this as follows: sudo apt-get update To set up this solution, we need to install postfix mailutils. However, if all that you want to do is save backups to a directory, then you can accomplish this using a simple script. However, not all storage locations allow you to upload files using shell commands. In most cases, a bash script is a good solution. This article will consider the following ways of carrying out these steps: Receive email notification concerning backup results.Send the backup to Internet storage using FTP, Dropbox, AWS, Google Drive, etc.In order to properly automate backups, you must follow the following steps: ![]() The automatic backup of MySQL Server databases is very important for preventing data loss. The solutions described in this blog post work for any Linux distribution: Ubuntu, Red Hat, Open SUSE, CentOS, Debian, Oracle Linux etcю However, the package installation commands may differ.
0 Comments
Leave a Reply. |