توضیحات: این ربات به طور خودکار از دیتابیس MySQL پشتیبان تهیه میکند و فایلهای پشتیبان را از طریق تلگرام ارسال میکند. systemd برای مدیریت و اجرای خودکار ربات استفاده میشود.
- سرور لینوکسی (Ubuntu، Debian، CentOS)
- نصب MySQL و Python 3.8+
- توکن ربات تلگرام از BotFather
- آیدی عددی کاربر مجاز از userinfobot
-
کلون کردن مخزن:
git clone https://github.com/Ahmad10611/telegram-backup-bot.git cd telegram-backup-bot
-
اجرای اسکریپت نصب:
chmod +x setup.sh ./setup.sh
-
ورودیهای لازم:
- توکن ربات تلگرام از BotFather
- آیدی عددی کاربر مجاز از userinfobot
- اطلاعات اتصال MySQL (نام کاربری، رمز عبور، دیتابیس، هاست)
-
مشاهده لاگها:
journalctl -u telegram-backup-bot.service -f
-
توقف ربات:
systemctl stop telegram-backup-bot
-
راهاندازی مجدد ربات:
systemctl restart telegram-backup-bot
-
حذف ربات:
systemctl stop telegram-backup-bot systemctl disable telegram-backup-bot rm /etc/systemd/system/telegram-backup-bot.service systemctl daemon-reload systemctl reset-failed
Overview: Automatically backs up MySQL and sends the files via Telegram using systemd for process management.
- Linux server (Ubuntu, Debian, CentOS)
- MySQL and Python 3.8+
- Telegram Bot Token from BotFather
- Authorized User ID from userinfobot
-
Clone the repository:
git clone https://github.com/Ahmad10611/telegram-backup-bot.git cd telegram-backup-bot
-
Run the setup script:
chmod +x setup.sh ./setup.sh
-
Required inputs:
- Telegram Bot Token from BotFather
- Authorized User ID from userinfobot
- MySQL connection info (username, password, database, host)
-
View logs:
journalctl -u telegram-backup-bot.service -f
-
Stop bot:
systemctl stop telegram-backup-bot
-
Restart bot:
systemctl restart telegram-backup-bot
-
Remove bot:
systemctl stop telegram-backup-bot systemctl disable telegram-backup-bot rm /etc/systemd/system/telegram-backup-bot.service systemctl daemon-reload systemctl reset-failed
概述: 自动备份 MySQL 并通过 Telegram 发送,使用 systemd 管理进程。
- Linux服务器 (Ubuntu, Debian, CentOS)
- MySQL 和 Python 3.8+
- Telegram 机器人令牌来自 BotFather
- 授权用户ID来自 userinfobot
-
克隆仓库:
git clone https://github.com/Ahmad10611/telegram-backup-bot.git cd telegram-backup-bot
-
运行安装脚本:
chmod +x setup.sh ./setup.sh
-
输入信息:
- Telegram 机器人令牌来自 BotFather
- 授权用户ID来自 userinfobot
- MySQL 连接信息 (用户名, 密码, 数据库, 主机)
-
查看日志:
journalctl -u telegram-backup-bot.service -f
-
停止机器人:
systemctl stop telegram-backup-bot
-
重启机器人:
systemctl restart telegram-backup-bot
-
删除机器人:
systemctl stop telegram-backup-bot systemctl disable telegram-backup-bot rm /etc/systemd/system/telegram-backup-bot.service systemctl daemon-reload systemctl reset-failed