Skip to content

Instantly share code, notes, and snippets.

@witnessmenow
Created September 22, 2017 10:58
Show Gist options
  • Save witnessmenow/bc74ecb1ef20a99f88051e81e6504aeb to your computer and use it in GitHub Desktop.
Save witnessmenow/bc74ecb1ef20a99f88051e81e6504aeb to your computer and use it in GitHub Desktop.
Backup a file using telegram, backup runs every day at 2:30
#!/bin/bash
tar cvzf /home/huginn/backup.tar.gz /home/huginn/mysql-data
curl -F chat_id="-110696711" -F document=@"/home/huginn/backup.tar.gz" https://api.telegram.org/botTOken/sendDocument
Create the backup.sh file and paste in contents of the file
Edit the crontab: crontab -e
30 2 * * * /root/backup.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment