How to backup Firefox to recover a potentially lost session

When you’ve ever misplaced your entire pinned and open tabs in Firefox, you know the way irritating it may be. Jack Wallen reveals you the way he backs up his session to get well tabs from the earlier occasion.


Picture: Mozilla

This is how my Firefox internet browser workflow goes.

Every morning, once I’m prepared to start out my first writing session, I log into my desktop PC and launch Firefox. When the browser opens, it begins at my earlier session (with all of my pinned tabs and different tabs I may need had open for analysis). I write and I write and I write. That goes on all through the day. When it comes time to show the lights out in my workplace, I shut Firefox (as a result of I take advantage of the Nightly launch and wish to apply the newest additions upon beginning the subsequent morning) and say goodnight. 

SEE: Guidelines: Server stock (TechRepublic Premium)

The subsequent day, I begin it yet again.

That workflow not often fails me.

However every so often, it does. You see, I’ve Firefox set to Restore earlier session (in Settings), so it all the time picks up the place I left off. That is the place it might turn into problematic. As an instance, for instance, I overlook that I had a second Firefox window open with a single tab. If I do not shut that secondary window first once I reopen Firefox the subsequent day, it should keep in mind no matter state it was in when it was final closed. If I shut that single window final … you see the place that is going.

So what do I do?

One strategy to keep away from such frustration is to recurrently again up a selected listing which homes the session state. It is not 100% foolproof, nevertheless it has helped me previously. 

I’ll present you the best way to do exactly that. I will be demonstrating on Linux, however this may be performed on macOS and Home windows as nicely (you simply have to regulate the directories and instruments used).

What you may want

The one factor you may want is a working occasion of Firefox. That is it. Let’s get to work.

How you can find your Firefox profile listing

The very first thing we should do is find our Firefox profile listing. To do that, open Firefox and kind about:help within the handle bar. Within the ensuing window (Determine A), search for the road Profile Listing.

Determine A


This web page offers you extra details about Firefox than you in all probability ever wanted.

Your Profile Listing shall be in /residence/USER/.mozilla/firefox/STRING.default

The place USER is your Linux username and STRING is a random string of characters.

Copy that full path.

How you can create the backup in Firefox

What we will do is use cron to create a each day backup that can happen earlier than Firefox is closed on the finish of the day. Say, as an illustration, you shut Firefox at 10 p.m. We’ll run the backup at 9 p.m. (that manner we all know we’re saving all of our open tabs).

We will create a script that can run the backup after which create a cron job that can run the script each night time at 9 p.m.

Create the script with the command:


In that script add the next:



tar -czvf $BLOC/firefoxbackup.tar.gz $BDIR

The place USER Is your Linux username and STRING is the random string of characters on your Firefox profile listing.

Save and shut the file.

Give the file executable permissions with:

chmod u+x

Check the file to verify it really works with:


After it completes, you need to see the file firefoxbackup.tar.gz in your ~/Paperwork listing. 

How you can create the cron job in Firefox

Now we will create the cron job. Open the crontab editor with:

crontab -e

On the backside of that file, we’ll add:

0 21 * * * /residence/USER/ >/dev/null 2>&1

You’ll be able to change the situation of the backupscript to be the place you favor. Simply ensure that, if you happen to change the situation of the script, that change is mirrored within the cronjob.

Now, at 9 p.m. each night time, your sessionstore-backups listing (the listing that really homes the knowledge on your classes) shall be backed as much as ~/Paperwork. Ought to something go fallacious that day, you possibly can restore Firefox to the earlier night time’s session and reclaim all of these open tabs.

No, this would possibly not restore the tabs you may have open in the meanwhile the issue happens, however it should prevent from having to reopen and re-pin all of these tabs. This little trick has saved me a very good period of time on just a few events. Set it up and hope you by no means must rely on the backup.

Additionally see

Recent Articles


Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox