Article directory
🆘Uptime Kuma backup is deprecated⁉️Come and see the scheduled automatic backup tutorial🕒💾
📉Uptime Kuma backup function is invalid? do not be afraid! Teach you how to set up scheduled automatic backup to protect your monitoring data💡📊.
From now on, you will no longer be afraid of data loss, the super detailed steps will make you understand in seconds📈🚀.
Come and learn, data security will be guaranteed from now on! 🎯📁
Because there may be some problems with the backup function in the background settings of Uptime Kuma, the developer has not maintained the backup function. Now the backup function is no longer able to generate a complete backup and restore all settings ▼

Deprecated: Due to the addition of a large number of new features and the lack of regular maintenance of the backup function, the backup function is no longer able to generate a complete backup and restore complete settings.
Please back up the docker volume or data folder (./data/) directly instead.
However, we can realize Uptime Kuma's backup data through the automatic backup script function.
Uptime Kuma monitoring data automatic backup method
The following are methods and steps for data backup:
- Create backup script:A simple shell script can be written to perform the backup job. This script will package Uptime Kuma's data directory into a tar compressed file and copy it to the specified backup path.
- Set up a scheduled task:The backup script can be set as a scheduled task (such as using crontab) to achieve regular automatic backup.
How to set up scheduled automatic backup script in Uptime Kuma?
Step 1:Find the installation path of the uptime-kuma data directory and enter the following command via SSH▼
cd /
find / -name uptime-kuma
Find the installation path of uptime-kuma ▼
/var/lib/docker/volumes/uptime-kuma
Step 2:On /backup2/directory, create a file containing the following code auto-backup-uptime-kuma.sh file
The following is an example of a backup script:
#!/bin/bash
cd /var/lib/docker/volumes
tar zcvf uptime-kuma.tgz uptime-kuma
cp -rf /var/lib/docker/volumes/uptime-kuma.tgz /backup2/uptime-kuma/uptime-kuma_"$(date +"%Y-%m-%d_%H-%M-%S")".tgz
rm -rf uptime-kuma.tgz
- In this script,
/var/lib/docker/volumes/uptime-kumais the path to your Uptime Kuma data directory, you may need to replace it with the actual path. /backup2/It is the location where you want to store the backup files, and it also needs to be replaced according to the actual situation.- After the backup script is executed, it creates a compressed file containing the current date and time, copies the file to the backup path, and finally deletes the original compressed file to save space.
Step 3:Set up Cron scheduled tasks
Edit Cron task list:
crontab -e
Step 4:Exit editing and save:
If you are using the default nano editor:
- After entering the content, press
Ctrl + X. - then press
YConfirm to save changes. - Finally press
EnterSave the file and exit.
If you are using vim editor:
- 按
EscEnter command mode. - enter
:wqSave and exit.
If you are using another editor (such as vi):
- 按
EscEnter command mode. - enter
:wqSave and exit.
In this way, your Cron task will be saved and start running according to the set time! 📅🔧
Step 5:Provide script execution permissions
If the script does not have execution permissions, you need to add execution permissions first and then run the script. ▼
chmod +x /backup2/auto-backup-uptime-kuma.sh
Step 6:Add it to the Corn Job scheduled task to run it automatically ▼
0 2 * * * /backup2/auto-backup-uptime-kuma.sh
- Now, the Corn Job scheduled task runs at 2 am every day▲
Step 7:The Corn Job scheduled task automatically deletes remote files 2 days or earlier at 30:50 a.m. every day (delete files older than 50 days) ▼
30 2 * * * rclone delete koofr:cwp-backup2 --min-age 50d
- It is recommended to regularly check the integrity of your backup files and ensure that the backup process is working as expected.
Want to learn more about Uptime Kuma usage tips and other useful tools? Click the link below to continue reading the following content▼
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "Uptime Kuma backup function has been deprecated: How to set up Corn scheduled automatic backup script? 》, helpful to you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-31701.html

