Created
August 15, 2018 16:10
-
-
Save changux/4238b0fa33d02f88fc6558120ba2285f to your computer and use it in GitHub Desktop.
Script to execute a gmail backup and sync to another account
This file contains 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
#!/bin/bash | |
# Add cron to execute every day | |
# 0 12 * * * cd ~/my/backup/script && ./backup-gmail-account.sh >> /var/log/script_output.log 2>&1 | |
# sudo pip install gmvault | |
# | |
BACKUPMAIL=$HOME/gmvault-db | |
# | |
# Initial setup | |
if [ ! -d "$BACKUPMAIL" ]; then | |
/usr/local/bin/gmvault sync [email protected] # or gapps mail account | |
else | |
# Incremental and sync | |
/usr/local/bin/gmvault sync -t quick [email protected] | |
/usr/local/bin/gmvault restore --type quick [email protected] | |
fi | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment