Firefox sync script

I don't know about you, but I'm not satisfied with the firefox sync. Some addons don't sync at all, sometimes sync breaks entirely without a visible error. The size limit is understandable, but then why is it so hard to set up your own sync server. Anyway, here is a simple solution that works for me.

I just rsync all profiles from one machine to another. For this to work reliably, both machines need to be running the same firefox version, and firefox has to be stopped on both. The script below is my attempt to perform this sync safely.

Raw
#!/bin/bash

target=$1

if [ -z "$target" ]; then
  echo "ffsync TARGET (example.com, user@example.com, etc)"
  exit 1
fi

if pgrep -af firefox-bin > /dev/null; then
  echo "Firefox is running, aborting"
  exit 2
fi

if ssh $target "pgrep -af firefox-bin"; then
  echo "Firefox is running on $target, aborting"
  exit 3
fi

echo "Firefox doesn't seem to be running. Syncing."

rsync --delete -avz ~/.mozilla/firefox ${target}:.mozilla/

0 comments

Reply

Cancel reply
Markdown. Syntax highlighting with <code lang="php"><?php echo "Hello, world!"; ?></code> etc.
DjangoPythonBitcoinTuxDebianHTML5 badgeSaltStackUpset confused bugMoneyHackerUpset confused bugX.OrggitFirefoxWindowMakerBashIs it worth the time?i3 window managerWagtailContainerIrssiNginxSilenceUse a maskWorldInternet securityPianoFontGnuPGThunderbirdJenkinshome-assistant-logo