From 962c748d3126f4a929273805b25a67678c685820 Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 30 Jul 2019 10:59:15 -0500 Subject: [PATCH] initial code --- email-backup-compress-upload.sh | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 email-backup-compress-upload.sh diff --git a/email-backup-compress-upload.sh b/email-backup-compress-upload.sh new file mode 100644 index 0000000..59d652a --- /dev/null +++ b/email-backup-compress-upload.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Purpose: Backup multiple email accounts, compress, upload to Drive + +# Requirements +# GAMADV-XTD3 - https://github.com/taers232c/GAMADV-XTD3/wiki +# GYB - https://github.com/jay0lee/got-your-back/wiki +# 7z - sudo apt-get install p7zip-full + +# Set some broad use case variables +today=`date +%Y-%m-%d` + +# Set the GYB variables +# Set your gyb path and gybdata values. gybbase is default format used +gyb=/home/steve/gyb/gyb +gybbase=GYB-GMail-Backup- +gybdata=/home/steve/gyb/GYB-GMail-Backup- + +# Set the GAM variables +# Change your user, gam path, shared drive ID +user=steve +gam=/home/steve/bin/gamadv-xtd3/gam +shared_drive=0ABxUabcdefgUk9PVA + +# Backup, Compress, Upload files +email=steve@domain.com +$gyb --email $email +7z u $gybdata$email.7z $gybdata$email +$gam user $user add drivefile localfile $gybbase$email.7z teamdriveparentid $shared_drive teamdriveparentname $today + +email=steve@another-domain.com +$gyb --email $email +7z u $gybdata$email.7z $gybdata$email +$gam user $user add drivefile localfile $gybbase$email.7z teamdriveparentid $shared_drive teamdriveparentname $today