

Test the file to make sure it works with. Give the file executable permissions with: chmod u+x firefoxbackup.sh Where USER Is your Linux username and STRING is the random string of characters for your Firefox profile directory. In that script add the following: #!/bin/bashīDIR="/home/USER/.mozilla/firefox/fault/sessionstore-backups" We’re going to create a script that will run the backup and then create a cron job that will run the script every night at 9 p.m.Ĭreate the script with the command: nano firefoxbackup.sh (that way we know we’re saving all of our open tabs). Say, for instance, you close Firefox at 10 p.m. What we’re going to do is use cron to create a daily backup that will occur before Firefox is closed at the end of the day. Where USER is your Linux username and STRING is a random string of characters.Ĭopy that full path. Your Profile Directory will be in /home/USER/.mozilla/firefox/fault This page gives you more information about Firefox than you probably ever needed. In the resulting window ( Figure A), look for the line Profile Directory. To do this, open Firefox and type about:support in the address bar. The first thing we must do is locate our Firefox profile directory. How to locate your Firefox profile directory The only thing you’ll need is a running instance of Firefox. I’ll be demonstrating on Linux, but this can be done on macOS and Windows as well (you just have to adjust the directories and tools used).


I’m going to show you how to do just that. It’s not 100% foolproof, but it has helped me in the past. One way to avoid such frustration is to regularly back up a specific directory which houses the session state. If I close that single window last … you see where that’s going. If I don’t close that secondary window first when I reopen Firefox the next day, it will remember whatever state it was in when it was last closed. Let’s say, for example, I forget that I had a second Firefox window open with a single tab. You see, I have Firefox set to Restore previous session (in Settings), so it always picks up where I left off.
