You are not logged in.

#1 2012-08-31 11:59:43

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

profile-cleaner reduces browser profile size by cleaning/reindexing

Profile-cleaner reduces browser profile size by cleaning/reindexing their sqlite databases.

Supported browsers:
*Chromium
*Conkeror
*Firefox
*Google-chrome
*Heftig's Aurora
*Midori
*Thunderbird
*QupZilla

If you can improve the code, plz send me a pull request.  Github: https://github.com/graysky2/profile-cleaner

Enjoy!

Sample output and results using an "uncleaned" firefox profile:
screen.jpg

Last edited by graysky (2013-02-15 23:22:01)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2012-08-31 12:41:17

nierro
Member
From: Milan, Italy
Registered: 2011-09-02
Posts: 808

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

Not to post too many thanks in the same thread... thank you very much again wink

Offline

#3 2012-08-31 13:51:53

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

It's okay, I like to be thanked.  Enjoy.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2012-08-31 14:13:43

mikkie
Member
Registered: 2009-11-10
Posts: 52

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

Another gem from you, graysky. Thanks a lot. Do you intend profile-cleaner to support opera in the future?

Offline

#5 2012-08-31 14:21:29

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

@mikkie - Easy to do if opera uses sqlite databases.  I haven't used it in a while...


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2012-08-31 14:52:02

mikkie
Member
Registered: 2009-11-10
Posts: 52

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

Ah, opera doesn't seem to use sqlite database. My bad.

Offline

#7 2012-09-08 12:22:38

maggie
Member
Registered: 2011-02-12
Posts: 248

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

Thank you graysky. I was looking to do this and found this thread! This is a great utility.

Offline

#8 2012-09-15 14:29:13

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

Glad you like it.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2012-09-15 19:39:29

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,482

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

Thank you for the tool.
Since some months, my firefox launcher is made with something like: "firefox ; for database in ~/.mozilla/firefox/koko/*.sqlite; do sqlite3 $database 'VACUUM;'; done"
...So that everytime i close the browser the databases are optimized.
The process with VACUUM is pretty fast if you do it everytime, but i noticed that your script takes a couple of time everytime i run it, probably because of reindexing?
Reindex helped to reduce the size for a very small amount (about 5MB on places.sqlite).

Does it provide a speed improvement other than a smaller size?

Last edited by kokoko3k (2012-09-15 19:40:16)

Offline

#10 2012-09-15 20:29:59

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

@koko - If you're sync'ing the profile using profile-sync-daemon, smaller profiles will sync faster.  Dunno if there is a noticeable improvement when using the browser or not.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2012-09-15 22:18:37

skydrome
Member
From: The Soviet States of Legos
Registered: 2012-09-03
Posts: 8
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

the slowness is from not using -maxdepth with all the `find`'s, it is iterating into every subdirectory

Offline

#12 2012-09-15 22:24:58

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

skydrome wrote:

the slowness is from not using -maxdepth with all the `find`'s, it is iterating into every subdirectory

Interesting observation.  I will modify the script.

EDIT: Done.  Version 1.3 contains a maxdepth 2 limitation.  I based this on my own firefox and chromium profiles.  Feedback?

Last edited by graysky (2012-09-15 22:37:23)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#13 2012-09-15 22:55:24

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,237

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

You're probably just ahead of yourself, but just a heads up: profile-cleaner-1.3.tar.xz is 404 on your website.

Love the tool though. Goes great with psd, cheers.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#14 2012-09-15 23:01:49

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

WorMzy wrote:

You're probably just ahead of yourself, but just a heads up: profile-cleaner-1.3.tar.xz is 404 on your website.

Love the tool though. Goes great with psd, cheers.

Thanks for the heads-up.  It's there now... I gotta add a sync step in my github update script.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#15 2012-09-15 23:07:31

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,237

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

Great stuff, just got it, thanks.

As an aside, do you think it'd be a good idea to add a .install file to tell users to shutdown their browser before running the script? I don't think vaccuming has any effect if the database is in use at the time.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#16 2012-09-15 23:11:17

skydrome
Member
From: The Soviet States of Legos
Registered: 2012-09-03
Posts: 8
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

im not sure yours is working right with the chromium's files (since they have spaces in them) or its just not showing it right.

aGGWM.png

https://github.com/skydrome/random/blob … -vacuum.sh

Edit: response to "patches welcome" => https://aur.archlinux.org/packages/browser-vacuum/ which works and does it properly.

Last edited by skydrome (2012-12-08 08:40:59)

Offline

#17 2012-09-16 10:23:28

fturco
Member
Registered: 2010-07-12
Posts: 36

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

@graysky: I think it would be a good idea if it could be possibile to apply this tool to Mozilla Thunderbird, too. It also uses .sqlite files.

Offline

#18 2012-09-16 11:33:23

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

@WorMzy - The .install warning is a good idea.  I will add it.
@skydrome - I will check into this.  Patches are welcome if you see a problem.
@fturco - OK.  I will look into a thunderbird function.

EDIT: All done in version 1.4 now in the AUR.  Thanks to junag who must have been following this thread smile

Last edited by graysky (2012-09-16 12:00:04)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#19 2012-09-16 12:44:01

fturco
Member
Registered: 2010-07-12
Posts: 36

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

I know almost nothing about sqlite3, but while the "vacuum" command seems to reduce the size of the databases, the "reindex" command seems to do nothing as size is concerned. Question: is the "reindex" command needed? What does it do in practice? I read http://www.sqlite.org/lang_reindex.html but I don't understand it much.

Offline

#20 2012-09-16 12:49:45

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#21 2012-09-22 08:48:17

daneel971
Member
Registered: 2008-03-28
Posts: 179

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

Hi and thanks for this script. smile
A little request:
I keep my thunderbird profile outside my home, and profile cleaner fails to find it.
The path to the profile is defined in profiles.ini with the "IsRelative" flag set to "0" - in this case, the line 70

find ${path}/$i -maxdepth 2 -name '*.sqlite' -print0 | xargs -0 -n 1 -I {} bash -c "do_clean {} 2>/dev/null"

should omit ${path}/, like

find $i -maxdepth 2 -name '*.sqlite' -print0 | xargs -0 -n 1 -I {} bash -c "do_clean {} 2>/dev/null"

Offline

#22 2012-09-22 12:24:46

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

OK... so if the variable 'IsRelative' is 0 then omit path from cleaning line?  You mind submitting a pull request?

Last edited by graysky (2012-09-22 13:36:05)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#23 2012-09-22 20:13:55

daneel971
Member
Registered: 2008-03-28
Posts: 179

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

You mind submitting a pull request?

Sorry, I have no idea how to do that.

Offline

#24 2012-09-23 20:31:51

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,517
Website

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

@daneel971 - Can you please try out my proposed code?  It lives in the unstable branch of profile-cleaner.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#25 2012-09-24 05:16:13

daneel971
Member
Registered: 2008-03-28
Posts: 179

Re: profile-cleaner reduces browser profile size by cleaning/reindexing

It works just fine - thanks again.

Offline

Board footer

Powered by FluxBB