docs.benjamin-altpeter.de

Telegram backup

The purpose of this VM is to automatically download all messages and media from my Telegram account and sync that to backup1.

Setup #

1. Install Java #

see http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer

2. Install fabianonline/telegram_backup #

  • mkdir -p /root/tgbkp/output
  • Download the latest release JAR from https://github.com/fabianonline/telegram_backup/releases to /root/tgbkp/telegram_backup.jar.
  • Run java -jar telegram_backup.jar --target /root/tgbkp/output to setup the account information.
  • Run java -jar telegram_backup.jar --target /root/tgbkp/output again and let it finish the initial download of all data.

3. Setup the cronjob #

  • Paste the following into root’s crontab (by running crontab -e):
    0 2,14 * * * /usr/bin/java -jar /root/tgbkp/telegram_backup.jar --target /root/tgbkp/output > /dev/null

References #