The little things give you away... A collection of various small helper stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
561 B

  1. #!/bin/bash
  2. # Usage: wpull2-extract-remaining [FILENAME]
  3. # FILENAME points to a wpull 2.x SQLite DB; if not specified, defaults to wpull.db
  4. # Prints all remaining URLs from the DB on stdout
  5. if [[ $# -eq 1 ]]
  6. then
  7. filename="$1"
  8. else
  9. filename=wpull.db
  10. fi
  11. if [[ ! -f "${filename}" ]]
  12. then
  13. echo "Error: ${filename} does not exist or is not a regular file" >&2
  14. exit 1
  15. fi
  16. for status in in_progress todo error
  17. do
  18. sqlite3 "${filename}" 'SELECT url_strings.url FROM queued_urls JOIN url_strings ON url_string_id = url_strings.id WHERE status = "'$status'"'
  19. done