jack: (Default)
[personal profile] jack
I use Firefox at home and at work. Is there a way to have common bookmarks between the two?

* There are a couple of firefox plugins (bookmark sort and sync and foxmarks) which puport to do this, but I haven't quite got them to work. I'm not sure if something is inherently wrong.

* Both use ftp, and require an ftp-to-sftp bridge. (Alternatively, interactive http (I can't remember the real name) which the server doesn't. Foxmarks by default stores your bookmarks on their server, but I'd rather not do that. Google does something similar? I have a perfectly good server. And I don't really want to make either of my computers an ftp-server, even indirectly.)

* I could sync the profile bookmark files elsehow. In fact, I generally bookmark something less than once a day, so simply periodically copying the files to/from a remote location would be fine. But it should EITHER be automatic, OR not break if I forget.

* At least one of the computers must be a windows computer.

* It would be *nice* if it could sync most things, but leave the bookmark toolbar alone.

So, it seems like it should be so obvious. But what is the right method? I could have a script which copies the files, but will it break if I go home early and bookmark something?

Date: 2007-01-15 05:27 pm (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
I sync my bookmarks between a Firefox at work, a Linux Firefox at home, and a Windows Firefox at home.

Sadly, I don't think the method I use would meet your requirements. (That's sad for me too, because they're good requirements :-)

For starters, I get Linux and Windows at home to actually share the bookmark file: there's an obscure config option somewhere which lets you give a Firefox an alternative pathname at which to find its bookmark file. So since I already have a shared file system between the two machines, I use this option to point the Windows version at the Linux one's bookmarks.

Synchronisation between the two sites is trickier, and I'm afraid I do it using a ghastly set of Perl scripts with an ssh in the middle. Currently the scripts work by checking the md5sums of everything and deducing what's happened by testing equality: when I run the sync utility at a given site, it'll check the md5sum of (a) my current bookmark file, (b) the last version of the bookmark file I uploaded, and (c) the current latest version on the server, and based on which of those are equal it will do something vaguely sensible. If they're all different it will assume I've changed bookmarks at both sites since my last sync, and send me mail so I can sort the mess out by hand. So I do have to manually remember to run the sync utility.

At one point I had an ambitious plan to rewrite all this so that it was able to cope robustly with the sorts of conflict likely to come up in bookmark files (at which point I'd be able to have it run automatically rather than relying on me remembering about it), and while I was at it to also extend it to support multiple bookmark file formats (so I could interoperate with Safari on my Mac). However, I never found the tuits and probably never will.

Date: 2007-01-16 10:53 am (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
"Ghastly set of Perl scripts with an ssh in the middle" sounds just like I was proposing. I wrote a spec in the next post. I don't know that it's any more inappropriate for me than anyone else :)

If you're fudging it *anyway* you could run the update automatically a few times a day. Then there's only a small chance you'll collide.

Date: 2007-01-16 10:57 am (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
Actually, the thing that worries me most about automatic updates is that they might modify the bookmark file while Firefox is actually running. I have a vague feeling that there are circumstances in which Firefox won't be happy with that at all. Manual sync means I can make sure to do it when FF is shut down.

Date: 2007-01-16 11:50 am (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Ah, hmm. I assumed that would be ok. Come to think of it, I did that manually while restoring. But I don't know if it borks if it non-atomically writes a bookmark, or similar.

Date: 2007-01-16 01:55 pm (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
Coincidentally enough, it bit me just now when I incautiously ran my synchroniser. The problem appears to be that when Firefox edits its bookmark file, it loads it into memory, and saves it out again on process exit. So I ran my synchroniser while Firefox was running; it pulled down a change from the server; I then quit Firefox, which wrote out the version of the file from before that change, effectively undoing the change. To make matters worse, I then ran the synchroniser again and it uploaded that change to the server, backing out the change I'd been trying to pull down.

Sorted it all out now, of course, but bah.