Skip to content

Instantly share code, notes, and snippets.

@Mehran
Last active January 9, 2019 05:42
Show Gist options
  • Save Mehran/7800b7c5b7fb5fd41e41268a5135bee5 to your computer and use it in GitHub Desktop.
Save Mehran/7800b7c5b7fb5fd41e41268a5135bee5 to your computer and use it in GitHub Desktop.
Instapy Backup
#!/bin/bash
### Author ###
# By : Mehran Goudarzi
# Release : 2019-01-06
# Description : InstaPy Backup
# Version : 1.1
###############
if [ ! -d /root/backup ]; then
mkdir -p /root/backup;
fi;
dropbox_uploader.sh info > /dev/null 2>&1 || {
read -p $"Your Dropbox Access Token: " token
git clone https://github.com/andreafabrizi/Dropbox-Uploader.git > /dev/null 2>&1 && cd Dropbox-Uploader
if grep -q 'The configuration has been saved.' <<< "$(echo -e "${token}\ny\n" | ./dropbox_uploader.sh)" ; then
echo " Ok" >&2
cp dropbox_uploader.sh /usr/sbin
fi
}
tar -zcvf /root/backup/"$(date '+%Y-%m-%d').tar.gz" /root/Instapy/ > /dev/null 2>&1
dropbox_uploader.sh upload /root/backup/"$(date '+%Y-%m-%d').tar.gz" /instapy-backup > /dev/null 2>&1
rm /root/backup/"$(date '+%Y-%m-%d').tar.gz"
curl -s "https://api.telegram.org/<TOKEN>/sendMessage?chat_id=<CHAT_ID>&text=Instapy Daily Backup Done @ $(date '+%Y-%m-%d')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment