Skip to content

Vahid-Spacer/MySQL-Telegram-Backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MySQL-Telegram-Backup πŸ€–πŸ’Ύ

Automated MySQL database backup solution with Telegram delivery

Cron Host

  • Once Per Minute(* * * * *)
/usr/bin/php -q /home/CpUser/public_html/Folder/db_backup.php>/dev/null 2>&1
  • Twice Per Day(0 0,12 * * *)
/usr/bin/php -q /home/CpUser/public_html/Folder/db_backup.php>/dev/null 2>&1

Cron Server

curl https://example.com/folder/db_backup.php/

πŸ”§ Features

  • Complete MySQL database backup (structure + data)
  • Direct delivery to Telegram (user/channel)
  • Clean file management (auto-delete after sending)
  • Detailed error logging
  • Supports both Gregorian and Jalali dates (commented)
  • Secure connection with cURL

βš™οΈ Technical Details

  • PHP 7.0+ compatible
  • Uses MySQLi for database operations
  • Telegram Bot API integration
  • cURL for secure file transfer
  • HTML-formatted captions with GitHub link

πŸ“¦ File Structure

  • jdf.php - Jalali date functions (included)
  • Configurable database credentials
  • Customizable backup filename format
  • Optional logging system

πŸ”„ Workflow

  1. Connects to MySQL server
  2. Backs up all tables with structure and data
  3. Sends SQL file via Telegram bot
  4. Cleans up temporary files
  5. Provides detailed operation logs
πŸ“… β†’ 2025/05/09 ⏰ β†’ 18:00
βš™οΈ GitHub

View on GitHub | Telegram Channel | Donate❀️

About

A simple yet powerful bot to backup MySQL databases and send them directly to Telegram

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages