Telebackup is a simple backup tool for Telegram. It allows you to back up your local files to Telegram. It uses tar & gzip to compress the files and then sends them to Telegram chat
- Supports multiple files/directories
- File upload up to 2GB
You can download prebuilt binaries from releases page
git clone https://github.com/aiexz/telebackup.git
cd telebackup
go build cmd/telebackup/main.go
docker run -v /path/to/config.yml:/config.yml -v /path/to/dir:/dr ghcr.io/aiexz/telebackup:master
- Create a Telegram bot using BotFather and get bot token
- Get APP ID & API Hash from my.telegram.org or use provided in example
- Edit
config.example.yml
and rename it toconfig.yml
- Run
./telebackup
or./telebackup --config /path/to/config.yml
appId: 6 # Telegram APP ID
appHash: eb06d4abfb49dc3eeb1aeb98ae0f581e # Telegram API Hash
botToken: 123:AAA # Telegram Bot Token
target: 56789123 # Telegram chat/channel username or chat ID
targets:
- /tmp/test # List of files/directories to back up
- /tmp/test2
Tip
It is recommended to create a group or channel with the bot to not spam your personal messages
Here is our minecraft server
services:
mc:
image: itzg/minecraft-server
ports:
- "25565:25565"
environment:
EULA: "TRUE"
volumes:
- ./data:/data
telebackup:
container_name: telebackup_mc
image: ghcr.io/aiexz/telebackup:master
depends_on:
- mc
environment:
APP_ID: 6
APP_HASH: 123
BOT_TOKEN: 123:abc
TARGET: 123
TARGETS: |
/data
volumes:
- ./data:/data:ro
We also add a cron job to backup the server every day
0 0 * * * docker start telebackup_mc
- Handle files larger than 2GB
- Support for forums (chats with topics)
- Support for usage without username, just chat ID
- Encryption/password protection
- Signing backups
All contributions are welcome. Feel free to open an issue or a pull request
- gogram - Awesome Telegram API library
- Telegram: @aiexz