- Instalar offlineimap y otras dependencias:
sudo apt-get install offlineimap nocache run-one
- Crear una config de offlineimap:
Tiene que ser un archivo llamado .offlineimaprc
en tu home, con el contenido que muestra el gist. Reemplaza lo que corresponda con tu path, usuario y password.
- Crear el script de backup:
Ponelo donde quieras, con el contenido que se muestra en el gist (backup_gmail.sh
), y hacé que sea ejecutable (chmod +x backup_gmail.sh
)
- (opcional) Si querés que se corra solo a cada hora, agregá esto a tu cron:
0 * * * * /path/al/backup_gmail.sh >> /path/donde/quieras/guardar/logs/backup_gmail.log 2>&1
Si no, corré el script a mano cuando quieras backupear y listo.