MA
masihjahangiri/CPBackupTG
Automated CyberPanel backup delivery to Telegram. One-liner install, systemd scheduling, configurable retention and intervals.
CPBackupTG
Automated backup manager for CyberPanel servers. Finds backup archives and delivers them directly to Telegram via the Bot API. One-liner install, systemd timer scheduling, and configurable retention.
Install
curl -fsSL https://raw.githubusercontent.com/masihjahangiri/CPBackupTG/main/install.sh | sudo bashThe installer walks you through configuration interactively: Telegram bot token, chat ID, backup directory, retention policy, and schedule interval.
Usage
After installation, use the cybertel command:
cybertel --send-backup # Send latest backup to Telegram now
cybertel --status # Show configuration and timer status
cybertel --configure # Reconfigure settings
cybertel --uninstall # Remove everythingHow It Works
- CyberPanel creates
.tar.gzbackup archives on its own schedule - The systemd timer triggers
cybertelat your configured interval cybertelfinds new backup files in the configured directory- Each backup is sent to your Telegram chat via the Bot API
sendDocumentendpoint - Old backups beyond the retention period are cleaned up
Scheduling Options
| Interval | Description |
|---|---|
| Hourly | Every hour |
| Every 6 hours | 4 times per day |
| Daily | Once per day |
| Every 3 days | Twice per week |
| Weekly | Once per week |
Configuration
Configuration is stored at /etc/cybertel/config.conf. Logs are written to /etc/cybertel/cybertel.log.
| Setting | Description |
|---|---|
TELEGRAM_BOT_TOKEN |
Bot token from @BotFather |
TELEGRAM_CHAT_ID |
Target chat or group ID |
BACKUP_DIR |
CyberPanel backup directory path |
BACKUP_RETENTION |
Number of days to keep backups |
BACKUP_INTERVAL |
Systemd timer interval |
Prerequisites
- CyberPanel server with backup scheduling configured
- Telegram bot token and chat ID
curlinstalled on the server
License
MIT