Link to home
Start Free TrialLog in
Avatar of subz0r69z0r
subz0r69z0r

asked on

How to backup multiple users' history.dat file

Gday,

I would like to be able to backup multiple users' history.dat files in their firefox profile folder. The file is found in:

/home/<user>/.mozilla/firefox/<random>.profile/history.dat

The problem is that there are two variables that change in the file path on a per user basis. The first is the username and the second is the <random> part of the profile.

cp /home/*/.mozilla/firefox/*/history.dat /dest/directory

The above command seems to work fine with the wildcards, however it runs in to a problem after the first history.dat file gets backed and complains about overwriting the existing file. Obviously I can force the overwrite but that would leave me with only one file.

Is there any way I can append the username to the file and back it up through something like rsync to a NAS.

i.e. history.dat_user1, history.dat_user2

I would like to do this daily and overwrite the files so only the latest copy of the history file is archived.

Cheers
ASKER CERTIFIED SOLUTION
Avatar of ygoutham
ygoutham
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of subz0r69z0r
subz0r69z0r

ASKER

Thanks!

I modified the script to use rsync and to mount and unmount a NAS drive. Just a quick note that *.profile did not work, I had to change it to *.

Cheers
thanks mate
great!  it worked on my fedora 7 box.  did not think of checking up with what flavor you had.  good luck in any case.