-
-
Save strpc/86472e5f229207257bd94fb74f34d231 to your computer and use it in GitHub Desktop.
Telegram backup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # создаем один tar.bz2 архив | |
| backupDirectory=<backups_directory> | |
| projectDirectory=<projects_directory> | |
| chatId=<telegram_chat_id> | |
| botToken=<telegram_bot_token> | |
| cd $backupDirectory | |
| tar -cvjf $backupDirectory/archive.full.tar.bz2 $projectDirectory | |
| split -b 40M archive.full.tar.bz2 "archiver.tar.bz.part" | |
| for i in `ls $backupDirectory | grep part` | |
| do | |
| curl -F chat_id=$chatId -F document=@$backupDirectory/$i https://api.telegram.org/bot$botToken/sendDocument | |
| done | |
| echo "finished" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment