Featured Post
Video summary of latest Cool Cavemen’s concert
I’ve just finished editing the video summary of the latest Cool Cavemen’s concert. It’s now available on YouTube: That video was mostly shot with my Canon EOS 7D in 1080p at 24fps, with a Tamron SP AF 17-50mm f/2.8 XR … Continue reading
4m² : the first short I worked on
4m², the first narrative short film I work on, was just made available on YouTube. I wasn’t expecting a public release that fast (and this makes a really pleasant surprise), so I had no time to prepare a more detailed … Continue reading
Stabilizing Cute Baby Goats
Stabilizing WHAT ?!? Baby goats. Cute baby goats. Yes, you’re reading it right. Look: Yeah, I know, this is a naive video that belongs to /r/aww. But any excuse is good to me when its all about playing with video. … Continue reading
Burlesque Burglary music video released
I’ve just released my last video project: a music video for Burlesque Burglary by Cool Cavemen. Here is the official announcement on the band website, and here is the video: It’s also the first time I produce subtitles, since I … Continue reading
Reusing vintage footage for Cool Cavemen’s concert intro
The goal of that project was to illustrate a pre-recorded soundtrack. The latter being to Cool Cavemen what The Ecstasy of Gold is to Metallica: a piece that is played before each show and serve as concert intro. It’s an … Continue reading
Nichrome Preview (and Behind the Scene) video
Two months ago (October 8th) I shot a video for Cool Cavemen. I haven’t talked about it on this blog yet, let’s fix this right now: The song is Nichrome, which is a brand new song that will be available … Continue reading
All my command lines
Here is a collection of commands lines, code and configuration snippets I collected for several years while working as an Open-Source Software Engineer: Files Management Archives System & Shell Network Hardware CD Burning Apache Web Video Audio Image Processing Text, … Continue reading
Recent Posts
How-To Backup Gmail with OfflineImap
Gmail’s content can be retrieved via IMAP, and we’ll use this way to backup all our mails thanks to OfflineImap, a generic IMAP synchronization utility.
Let’s start by creating a dedicated configuration file in your home directory. Its content is quite straight-forward, as you can see in my /home/kevin/.offlineimaprc, which backup two Gmail accounts:
[general] accounts = gmail_account1, gmail_account2 maxsyncaccounts = 3 ui = Noninteractive.Basic [Account gmail_account1] localrepository = gmail_account1_local remoterepository = gmail_account1_remote [Repository gmail_account1_local] type = Maildir localfolders = ~/gmail-backup-account1 [Repository gmail_account1_remote] type = IMAP remotehost = imap.gmail.com remoteport = 993 remoteuser = account1@gmail.com remotepass = XXXXXXXX ssl = yes maxconnections = 1 realdelete = no folderfilter = lambda foldername: foldername not in ['[Gmail]/%s' % f for f in ['All Mail', 'Trash', 'Spam', 'Starred', 'Important']] [Account gmail_account2] localrepository = gmail_account2_local remoterepository = gmail_account2_remote [Repository gmail_account2_local] type = Maildir localfolders = ~/gmail-backup-account2 [Repository gmail_account2_remote] type = IMAP remotehost = imap.gmail.com remoteport = 993 remoteuser = account2@gmail.com remotepass = XXXXXXXX ssl = yes maxconnections = 1 realdelete = no folderfilter = lambda foldername: foldername not in ['[Gmail]/%s' % f for f in ['All Mail', 'Trash', 'Spam', 'Starred', 'Important']]
Notice how we use a Python lambda expressions to filter out some Gmail’s virtual folders.
Then all you have to do is to launch the offlineimap command-line itself with the right user, for example in a cron job:
00 20 * * * kevin offlineimap
A final warning: OfflineImap is fully bi-directional. This mean local deletion propagates to the remote server. This is can be quite dangerous so be careful not touching your local folders. If for any reason you’d like to reset your backups, stop OfflineImap processes first, then remove its cache folder (~/.offlineimap/) before removing the local folders themselves (~/gmail-backup-account*).
Also, intensively playing with OfflineImap to adjust its configuration may trigger the infamous Gmail’s “Temporary Error 500″. In this case don’t panic: it seems to be a common Gmail’s auto-immune response against suspect activity. It happened to me and in the end my account and mails were safe: I just had to wait a few hours to let it resume normal operations.