Thursday, February 19, 2015

Backup Evolution Email By Hand

I have been an Evolution user for as long as I can remember...
One thing I've noticed is that the built-in backup tool gets worse and worse as time goes by... On the latest Evolution, the one on Linux Mint 17/ Ubuntu 14.04 LTS, the backup simply backups configuration files, the whole tgz file only has something like 2 MB in size, while I really have some serious shit load of emails and data...

So, it was time to do a and old fashion backup by hand on the thing...
This is the script I'm using...

#!/bin/sh
## --------------------------
## Copies all Evolution files to the Dillinger external USBD HDD
## --------------------------

## -----------------------------------------------------
## Kill all Evolution procs BEFORE executing this script
## -----------------------------------------------------

## https://help.gnome.org/users/evolution/stable/data-storage.html.en

## The user's data files
## ~/.local/share/evolution
## 27 MB

## Various configuration and state files
## ~/.config/evolution
## 4 MB

## Account settings
## ~/.config/evolution/sources
## 100KB

## Disposable data caches
## ~/.cache/evolution
## 4.6 GB

## Configuration settings in GSettings
## ~/.config/dconf
## 1.2 MB

## ~/.gconf/apps/evolution

RSYNC="/usr/bin/rsync"
RSYNC_FLAG_00="-avzr"
RSYNC_FLAG_01="--progress --delete"
LOG="/tmp/_sync.local.evo.log"

## -----------------------------------------------

echo "BEGIN user's data files... "

EVO_USER_DATA_FILES_SRC="/home/USER/.local/share/evolution/"
EVO_USER_DATA_FILES_DEST="/media/USER/Dillinger/Backups/home/USER/.local/share/evolution/"

cd ${EVO_USER_DATA_FILES_SRC}
${RSYNC} ${RSYNC_FLAG_00} ${RSYNC_FLAG_01} * ${EVO_USER_DATA_FILES_DEST} > ${LOG}

## -----------------------------------------------

echo "BEGIN Various configuration and state files... "

EVO_CONFIGURATION_STATE_FILES_SRC="/home/USER/.config/evolution/"
EVO_CONFIGURATION_STATE_FILES_DEST="/media/USER/Dillinger/Backups/home/USER/.config/evolution/"

cd ${EVO_CONFIGURATION_STATE_FILES_SRC}
${RSYNC} ${RSYNC_FLAG_00} ${RSYNC_FLAG_01} * ${EVO_CONFIGURATION_STATE_FILES_DEST} >> ${LOG}

## -----------------------------------------------

echo "BEGIN Account settings... "

EVO_ACCOUNT_SETTINGS_SRC="/home/USER/.config/evolution/sources/"
EVO_ACCOUNT_SETTINGS_DEST="/media/USER/Dillinger/Backups/home/USER/.config/evolution/sources/"

cd ${EVO_ACCOUNT_SETTINGS_SRC}
${RSYNC} ${RSYNC_FLAG_00} ${RSYNC_FLAG_01} * ${EVO_ACCOUNT_SETTINGS_DEST} >> ${LOG}

## -----------------------------------------------

echo "BEGIN Disposable data caches This one is BIG... "

EVO_DISPOSABLE_DATA_CACHE_SRC="/home/USER/.cache/evolution/"
EVO_DISPOSABLE_DATA_CACHE_DEST="/media/USER/Dillinger/Backups/home/USER/.cache/evolution/"

cd ${EVO_DISPOSABLE_DATA_CACHE_SRC}
${RSYNC} ${RSYNC_FLAG_00} ${RSYNC_FLAG_01} * ${EVO_DISPOSABLE_DATA_CACHE_DEST} >> ${LOG}

## -----------------------------------------------

echo "BEGIN Configuration settings in GSettings... "

EVO_CONFIGURATION_SETTINGS_GSETTINGS_SRC="/home/USER/.config/dconf/"
EVO_CONFIGURATION_SETTINGS_GSETTINGS_DEST="/media/USER/Dillinger/Backups/home/USER/.config/dconf/"

cd ${EVO_CONFIGURATION_SETTINGS_GSETTINGS_SRC}
${RSYNC} ${RSYNC_FLAG_00} ${RSYNC_FLAG_01} * ${EVO_CONFIGURATION_SETTINGS_GSETTINGS_DEST} >> ${LOG}

## -----------------------------------------------

# EoF #

Labels: , , , , ,

0 Comments:

Post a Comment

<< Home