Synchronizing Firefox Bookmarks with CVS

This is more of a dirty little helper than a clean solution, but it suits me well. I only know of one other tool for synchronizing bookmarks between multiple computers: The Bookmarks Synchronzier (FTP) uses FTP to do the job, but I prefer CVS (or any other version control system in the future) because I already use that for various tasks.

The main problems with synchronizing bookmarks via CVS are conflicts, which come up naturally (changed bookmark properties) or because of some flags (like last visit or last modification date for folders). To reduce the latter, I use this dirty little script:


#!/bin/bash
bookmarks=`echo ~/.firefox/default/*/bookmarks.html`

cd `dirname $0`
sed -e s/LAST_VISIT=”[0-9]\+” // \
-e s/LAST_MODIFIED=”[0-9]\+” // < $bookmarks > bookmarks.html
cvs update

It first copies the bookmarks.html, removes the conflict-prone LAST_VISIT and LAST_MODIFIED tags and then updates from the CVS repository. Then you got to manually resolve all remaining conflicts (look for “>>>” in bookmarks.html). Finally I use another script to commit the changes and copy back the new – synchronized – bookmarks file. All that has to be done while Firefox is closed. (It’s a good idea to close Firefox from time to time anyway, holy memory leak…)


#!/bin/bash
bookmarks=`echo ~/.firefox/default/*/bookmarks.html`

cd `dirname $0`
cvs commit -m foo
cp bookmarks.html $bookmarks

3 Responses to “Synchronizing Firefox Bookmarks with CVS”

  1. Beate Says:

    Warum einfach, wenn’s auch kompliziert geht? 😉
    FTP-Bookmarks Synchronizer

  2. Beate Says:

    Ohoh 🙁
    Wer richtig lesen kann… Mea culpa 😉

  3. neingeist Says:

    @beate: wirklich komplizierter wäre für mich extra zum bookmarks-synchronisieren einen ftp-server aufzusetzen, da sind ein paar zeilen script doch hübscher 🙂 (dürfte auch weniger code sein, als das ganze boomarks-plugin)