When you’ve ever misplaced all your 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

Here is how my Firefox net browser workflow goes.

Every morning, after I’m prepared to begin 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 might 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 following morning) and say goodnight. 

SEE: Guidelines: Server stock (TechRepublic Premium)

The subsequent day, I begin it over again.

That workflow not often fails me.

However occasionally, it does. You see, I’ve Firefox set to Restore earlier session (in Settings), so it at all times picks up the place I left off. That is the place it may possibly turn out to be problematic. To illustrate, 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 after I reopen Firefox the following day, it would 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 approach to keep away from such frustration is to frequently again up a particular listing which homes the session state. It isn’t 100% foolproof, however it has helped me prior to now. 

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

What you may want

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

Tips on how to find your Firefox profile listing

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

Determine A

firefoxrecovera.jpg

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

Your Profile Listing will probably be in /dwelling/USER/.mozilla/firefox/STRING.default

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

Copy that full path.

Tips on how to create the backup in Firefox

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

We will create a script that may run the backup after which create a cron job that may run the script each evening at 9 p.m.

Create the script with the command:

nano firefoxbackup.sh

In that script add the next:

#!/bin/bash

BDIR="/dwelling/USER/.mozilla/firefox/STRING.default/sessionstore-backups"
BLOC="/dwelling/USER/Paperwork"

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

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

Save and shut the file.

Give the file executable permissions with:

chmod u+x firefoxbackup.sh

Take a look at the file to ensure it really works with:

./firefoxbackup.sh

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

Tips on how to 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 * * * /dwelling/USER/firefoxbackup.sh >/dev/null 2>&1

You possibly can change the placement of the backupscript to be the place you favor. Simply be sure, when you change the placement of the script, that change is mirrored within the cronjob.

Now, at 9 p.m. each evening, your sessionstore-backups listing (the listing that really homes the data to your classes) will probably be backed as much as ~/Paperwork. Ought to something go flawed that day, you may restore Firefox to the earlier evening’s session and reclaim all of these open tabs.

No, this would possibly not restore the tabs you’ve open for the time being the issue happens, however it would prevent from having to reopen and re-pin all of these tabs. This little trick has saved me period of time on a number of events. Set it up and hope you by no means should rely on the backup.

Additionally see

Leave a Reply