我正在使用硬盘驱动器适中的笔记本电脑,而Google Chrome浏览器的“历史索引”和“缩略图”文件占用了500MB的空间。其中一些文件已经使用一年了。Chrome为我提供了删除最近历史记录的选项,但我想要相反的选择:我想删除旧历史记录。(理想情况下,我将删除最近最少使用的历史记录信息,但我不希望能够做到这一点。)
有人有主意吗?我正在运行标准的Debiangoogle-chrome-beta
软件包。
对Google感到可耻,还没有办法。
除此之外,所有的Chrome数据库都只是sqlite3文件,您可以使用sqlite3清除不需要的条目。首先,安装sqlite3
客户端(sudo apt-get install sqlite3
),然后转到Chrome配置(应为.config/chrome/Default
)。
这是一个SQL片段,可从历史记录中清除旧的URL(适用于数据库History
,Archived History
):
delete from urls where last_visit_time <= (strftime('%s',(select
max(last_visit_time)/10000000 from urls),'unixepoch','-1 days')*10000000);
这是另一种可能适用于Thumbnails
数据库的方法:
attach database 'History' as history;
delete from thumbnails where last_updated <= (strftime('%s',(select
max(last_visit_time)/10000000 from history.urls),'unixepoch','-1 days')
*10000000);
这可能适用于History Index
-es:
attach database 'History' as history;
delete from info i, pages_content pc where i.time <= (strftime('%s',(select
max(last_visit_time)/10000000 from history.urls),'unixepoch','-1 days')*
10000000) and i.rowid = pc.rowid;
当然,您应该备份所有数据库,因为您可能具有不同版本的Chrome,或者我可能会意外丢失符号等。
由于Chrome以基于UNIX Epoch的某种奇怪格式存储时间(但乘以10 ^ 7并移至将来),因此无法使用返回日期的系统函数;而是使用最后一页打开的日期。
您可以替换-1 days
为任意间隔。您可以在SQLite文档中了解允许的修饰符(简称:-N days
,-N months
)。
删除不需要的数据后,您可能需要发出vacuum;
命令以进一步缩小数据库。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句