Guide to Installing Free Tools for Automated Website and Database Backups on Any Linux OS
In the process of operating websites and database systems, periodic data backup is an indispensable step to ensure safety and minimize risks when incidents occur. However,...
In the process of operating websites and database systems, periodic data backup is an indispensable step to ensure safety and minimize risks when incidents occur. However, manual backup is often time-consuming, easy to forget, or inconsistently performed across servers.
Therefore, in this article, VPTS will guide you on how to install and configure free tools to automate website and database backups across all popular Linux operating systems today.
This solution is not only free and easy to deploy, but also flexibly customizable for various web applications such as WordPress, Laravel, or custom-built systems.
In professional website operation environments, periodic data backup is a vital factor to ensure information security and maintain continuous operations. This article will guide you on how to set up an automated backup tools system for websites and MySQL databases, compatible with all Linux operating systems such as Ubuntu, CentOS, AlmaLinux, etc.
Buy VPS at VPTSInfrastructure using backup tools
In this Tools Backup system, we deploy on VPS provided byVPTS:
VPS No. 1 – Main Server - Refer to purchasing VPS via the following link: /cloud-vps-nvme/
Optional if you already have a VPS and can already host a website.
Operating system: Ubuntu, AlmaLinux, CentOS
Hosting service on VPS:aaPanel
Store websites and MySQL databases
VPS No. 2 – Cloud Storage Server - Refer to purchasing VPS via the following link:/cloud-storage/
Operating system: Optional Linux (Ubuntu, CentOS, AlmaLinux are all supported
Used to store backup data from the main VPS
Key features of backup tools
Auto-backup website directory
- Back up the entire MySQL database
- Send backup files to a remote storage VPS via SSH
- Save logs, report errors, and send detailed notification emails
- Option for automated daily runs via systemd timer
- Supports all popular Linux operating systems
Download file that automatically downloads and installs backup tools
Copyif [ -f /etc/redhat-release ]; then yum update -y && yum install -y wget; elif [ -f /etc/debian_version ]; then sudo apt update -y && sudo apt install -y wget; fi && wget -O toolsbackupvpsttt.sh https://sharettt.com/multimedia/toolsbackupvpsttt.sh && chmod +x toolsbackupvpsttt.sh && ./toolsbackupvpsttt.sh | tee toolsbackupvpsttt.log
Run the backup tools config menu
Copy/usr/local/bin/backupvpsttt
First, edit the backup tool configuration with the first option
Explanation:
📌 Line 1 – Backup storage VPS IPNhập IP VPS lưu backup (hiện tại: 103.238.234.73 nhấn enter để giữ nguyên):This is the public IP address of the VPS acting asbackup data storage server.
Users enter a new IP if they wish to change it, or press Enter to keep it as is.
📌 Line 2 – VPS UsernameNhập username VPS (hiện tại: root nhấn enter để giữ nguyên):SSH account used to connect to the backup VPS. The default is usuallyroot, but another user can be used if appropriate permissions are granted.
📌 Line 3 – VPS SSH PasswordSSH password for the account above, used by
Nhập password VPS (hiện tại: KXW0HN&%SY# nhấn enter để giữ nguyên):sshpassto automate connections and file transfers.
📌 Line 4 – Backup storage directory (on backup VPS)Is the root directory where backup files will be stored on the storage VPS.
Nhập thư mục lưu backup (hiện tại: /home nhấn enter để giữ nguyên):
The system will automatically create time-based subdirectories such as/home/12_06_2025_01_00_00/
.📌 Line 5 – Directory to backup (on primary VPS)Directory containingwebsite source codeor data to back up.
Nhập thư mục cần backup (hiện tại: /www/wwwroot/booking.devttt.com/ nhấn enter để giữ nguyên):
For systems usingaaPanel, usually located in/www/wwwroot/tên_miền/.
📌 Line 6 – MySQL AccountMySQL username with read permissions across the entire database.
Nhập tài khoản MySQL (hiện tại: sql_booking_devt nhấn enter để giữ nguyên):
Used in commandmysqldump.
📌 Line 7 – MySQL PasswordPassword for the MySQL user above.
Nhập mật khẩu MySQL (hiện tại: EwfwKEZ6aXhXptRN nhấn enter để giữ nguyên):
If entered incorrectly, the script will not be able to back up the database.
✅ Notification line upon completion✔️ Đã cập nhật cấu hình backup thành công!Nhấn Enter để quay lại menu...
Next, edit the backup tool's email configuration with the second option
Explanation:
📌 Line 1 – SMTP ServerThis is the outgoing email server address (SMTP).
Nhập SMTP Server (hiện tại: smtp.gmail.com nhấn enter để giữ nguyên):
Commonly used:
Gmail: smtp.gmail.comZoho: smtp.zoho.comOutlook: smtp.office365.com📌 Line 2 – SMTP PortSMTP connection port:
Nhập SMTP Port (hiện tại: 465 nhấn enter để giữ nguyên):465: SSL (high security – common)587: TLS (also supported)
📌 Line 3 – SMTP UserNhập SMTP User (hiện tại: [email protected] nhấn enter để giữ nguyên):Email account used to send notifications.
This is the address that appears in the "From" field when receiving backup report emails.
📌 Line 4 – SMTP PasswordIs the App Password of the outgoing email.
Nhập SMTP Password (hiện tại: mvbczbafopzmkind nhấn enter để giữ nguyên):
If you use Gmail, you need to enable 2-step verification and generate an App Password in Google security settings.
📌 Line 5 – Notification emailThe email address willreceive backup result reports, including timestamp, size, errors (if any)...
Nhập Email nhận thông báo (hiện tại: [email protected] nhấn enter để giữ nguyên):
Multiple recipients can be entered (separated by commas) if needed.
✅ Configuration complete✔️ Đã cập nhật cấu hình email thành công!
Nhấn Enter để quay lại menu...
Other options
Option 3 lets you review current configurations and check for mistakes. Option 4 lets you test the SSH connection to the storage VPS. Option 5 lets you test the MySQL connection. Option 6 lets you run a manual backup to the storage VPS.Change schedule settings to automatically run backup tools to storage VPS
Copynano /etc/systemd/system/backupvpsttt.timer
Save the configuration by pressing Ctrl + X -> Y -> Enter
Some results from backup tool systems
Image of data storage on storage VPS
Image of email notification after performing backup
VPTS – Comprehensive Digital Infrastructure Solutions Provider
VPTS is a digital infrastructure solution provider in Vietnam, serving deployment, operation, and data storage needs for individuals, developers, and enterprises. The service ecosystem includesVietnam VPS, International VPS, VPS Anti DDoS, Hosting cPanel, dedicated server, Rack rental, Proxy IPv4/IPv6, S3 MinIOandCloud Storage.
Besides providing infrastructure resources, VPTS also focuses on assisting customers with deployment, configuration, and practical troubleshooting. Content on the VPTS Blog is drawn from common scenarios in operating VPS, servers, and online systems, helping readers understand root causes and apply clear solutions.
VPTS – Stable infrastructure, flexible solutions, and continuous partnership throughout operations.
VPTS Team Contact Information
Website: https://vpts.shop
Facebook: https://www.facebook.com/trang.vpsttt/
Zalo OA: https://zalo.me/vpstttgroup
Hotline: 0328 812 674