|
|
@@ -1,6 +1,6 @@ |
|
|
|
#!/bin/bash |
|
|
|
# Usage: wpull2-requeue [ACTION] [FILENAME] [--where] URLPATTERN_OR_WHERE |
|
|
|
# ACTION can be 'count' (default), 'print', or 'write' |
|
|
|
# ACTION can be 'count' (default), 'print', or 'write'. On 'write', the number of modified records is printed. |
|
|
|
# FILENAME defaults to 'wpull.db' |
|
|
|
# URLPATTERN_OR_WHERE is URLPATTERN if --where isn't used or WHERE if it is. |
|
|
|
# URLPATTERN uses SQLite's LIKE syntax with ESCAPE "\", i.e. % matches any number of characters, _ matches exactly one character, and a backslash can be used to escape these special characters. |
|
|
@@ -46,7 +46,7 @@ query='FROM queued_urls JOIN url_strings ON url_string_id = url_strings.id WHERE |
|
|
|
|
|
|
|
if [[ "${action}" == 'write' ]] |
|
|
|
then |
|
|
|
sqlite3 "${filename}" 'UPDATE queued_urls SET status = "todo", try_count = 0, status_code = NULL WHERE id IN (SELECT queued_urls.id '"${query}"')' |
|
|
|
sqlite3 "${filename}" 'UPDATE queued_urls SET status = "todo", try_count = 0, status_code = NULL WHERE id IN (SELECT queued_urls.id '"${query}"'); SELECT changes()' |
|
|
|
elif [[ "${action}" == 'print' ]] |
|
|
|
then |
|
|
|
sqlite3 "${filename}" "SELECT queued_urls.*, url_strings.* ${query}" |
|
|
|