App-DumpFirefoxHistory

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	- [ux] Add --attempt-orig-first (default false). So now by default we
          copy the database first.

	- [ux] Simplify CLI by disabling reading config/env, enable
	  logging.


0.003   2019-08-14  Released-By: PERLANCAR; Urgency: medium

	- Like dump-chrome-history, now also copy places.sqlite to a
	  temporary file, when locked.

	- [incompatible change] Change default profile from default to
          default-release.


0.002   2017-11-01  Released-By: PERLANCAR

	- Update to new Firefox profile directory name (/\w+\.NAME-\d+/
	  instead of just /\w+\.NAME/).

lib/App/DumpFirefoxHistory.pm  view on Meta::CPAN

option is not specified, history from all profiles will be dumped.

_
        },
        attempt_orig_first => {
            schema => 'bool*',
            default => 0,
            'summary' => 'Attempt to open the original history database '.
                'first instead of directly copying the database',
            'summary.alt.bool.not' => 'Do not attempt to open the original history database '.
                '(and possibly get a "locked" error), proceed directly to copy it',
        },
        copy_size_limit => {
            schema => 'posint*',
            default => 100*1024*1024,
            description => <<'_',

Firefox often locks the History database for a long time. If the size of the
database is not too large (determine by checking against this limit), then the
script will copy the file to a temporary file and extract the data from the
copied database.

lib/App/DumpFirefoxHistory.pm  view on Meta::CPAN

                    if ($args{detail}) {
                        push @rows, $row;
                    } else {
                        push @rows, $row->{url};
                    }
                }
            };
            my $err = $@;
            log_info "Got DBI error: $@" if $err;
          COPY: {
                unless (!$args{attempt_orig_first} && $num_attempts == 1 || $err && $err =~ /database is locked/) {
                    last;
                }
                my $size = -s $history_path;
                unless ($size <= $args{copy_size_limit}) {
                    log_trace "Not copying history database to tempfile, size too large (%.1fMB)", $size/1024/1024;
                }
                require File::Copy;
                require File::Temp;
                my ($temp_fh, $temp_path) = File::Temp::tempfile();
                log_trace "Copying $history_path to $temp_path ...";



( run in 0.433 second using v1.01-cache-2.11-cpan-49f99fa48dc )