windows批处理sqlite备份firefox历史记录
不熟悉 Windows 的东西..,我正在尝试编写一些 MS Windows 批处理以备份 Firefox 历史记录,但我没有得到预期的结果,例如将 Firefox 历史记录转储到文件中(此处未实现),并且无法弄清楚为什么以及如何解决。相反,我在新窗口中获得数据库转储。这是我到目前为止所做的:
cmd windows 终端
start "TEST" sqlite.cmd
sqlite.cmd
REM backup firefox history
setlocal
set DB_src=places.sqlite
set DB_dest=places1.sqlite
set FF_profile=C:\Documents and Settings\User_A\Application Data\Mozilla\Firefox\Profiles\1e6xxxxx.default
set SQLITE_EXE=C:\Documents and Settings\Admin_User\SoftWare\sqlite3.exe
set SQLITE_SQL=C:\Documents and Settings\Admin_User\Bureau\sqlite.sql
copy "%FF_profile%\%DB_src%" "%FF_profile%\%DB_dest%"
@echo off
start "%SQLITE_EXE%" "%FF_profile%\%DB_dest%" < "%SQLITE_SQL%"
endlocal
sqlite.sql
.dump html
.output moz_places.html
SELECT moz_places.visit_count, moz_places.url FROM moz_places ORDER by visit_count DESC LIMIT 20;
[编辑]:
解决过:
- 使用正确的 sqlite 查询(在下面的 sqlite.sql 中更新),如这些示例。
- 使用 sql html 输出“moz_places.html”,因为我无法进行重定向工作。
linux的东西对我来说更容易......
Not familiar with windows stuffs.. , I'm trying to write a little MS Windows batch in order to backup firefox history but I'm not getting the expected result, eg the firefox history dump into a file (not implemented here), and can't figure out why and how to solve. Instead I get a dump of the database in a new window. Here is what I've done till now :
cmd windows terminal
start "TEST" sqlite.cmd
sqlite.cmd
REM backup firefox history
setlocal
set DB_src=places.sqlite
set DB_dest=places1.sqlite
set FF_profile=C:\Documents and Settings\User_A\Application Data\Mozilla\Firefox\Profiles\1e6xxxxx.default
set SQLITE_EXE=C:\Documents and Settings\Admin_User\SoftWare\sqlite3.exe
set SQLITE_SQL=C:\Documents and Settings\Admin_User\Bureau\sqlite.sql
copy "%FF_profile%\%DB_src%" "%FF_profile%\%DB_dest%"
@echo off
start "%SQLITE_EXE%" "%FF_profile%\%DB_dest%" < "%SQLITE_SQL%"
endlocal
sqlite.sql
.dump html
.output moz_places.html
SELECT moz_places.visit_count, moz_places.url FROM moz_places ORDER by visit_count DESC LIMIT 20;
[EDIT]:
Worked around :
- using the right sqlite query (updated in sqlite.sql below)as for these examples.
- using the sql html output "moz_places.html" as I could not get the redirection work.
linux stuffs are easier for me...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题很蹩脚,因为它涉及三个完全不相关的领域:firefox、sqlite 和批处理文件。您应该通过确定这是 Firefox 问题、sqlite 问题还是批处理文件问题来隔离问题,然后您应该提出有关问题所在域的问题,绝对不提及其他域。
关于批处理文件,我将尽我所能给您一个答案:
首先,您需要停止不必要地使用
start
命令并直接调用事物。因此,您需要这样:
然后,您需要将上述命令的输出重定向到您选择的文件中。为此,您需要使用“>”操作员。所以:
就批处理文件而言,应该可以了。如果没有,那么就是 Firefox 或 sqlite 的问题。
This question is lame, because it involves three completely unrelated domains: firefox, sqlite, and batch files. You should have isolated the problem by determining whether this is a firefox issue or an sqlite issue or a batch file issue and then you should have come up with a question regarding the domain in which the issue lies, with absolutely no mention to the other domains.
I am going to give you an answer as best as I can regarding batch files:
First of all, you need to stop needlessly using the
start
command and just invoke things directly. So, instead of:You need this:
Then, you need to redirect the output of the above command into a file of your choice. For this, you need to make use of the '>' operator. So:
That should do it, as far as batch files are concerned. If it does not do it, then it is a firefox or sqlite issue.