diff options
| author | Bjorn Monnens <bjorn.monnens@jidoka.be> | 2024-11-09 15:08:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-09 14:08:23 +0000 |
| commit | e57937e118328a98d71325c536da1ee9e3537954 (patch) | |
| tree | a58c70f686aa1b3bc54378026ce94adef1a7fb5e | |
| parent | a24755d92ce399beaf9575b75625c179e371b0c5 (diff) | |
| download | karakeep-e57937e118328a98d71325c536da1ee9e3537954.tar.zst | |
docs: Update CLI importing docs to better handle large collections (#630)
Importing through a bash script, necessary in case the errror "xargs: command line cannot be assembled, too long" occurs. Only tested on Mac, but should work on all environments
| -rw-r--r-- | docs/versioned_docs/version-v0.18.0/10-import.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/versioned_docs/version-v0.18.0/10-import.md b/docs/versioned_docs/version-v0.18.0/10-import.md index b4e31d44..b2cb0dbf 100644 --- a/docs/versioned_docs/version-v0.18.0/10-import.md +++ b/docs/versioned_docs/version-v0.18.0/10-import.md @@ -36,6 +36,19 @@ If you can get your bookmarks in a text file with one link per line, you can use cat all_links.txt | xargs -I{} hoarder --api-key <key> --server-addr <addr> bookmarks add --link {} ``` +alternatively if you get the error (xargs: command line cannot be assembled, too long), this means your URL is to long. Following bash script can be used to import a file that contains the URLs + +``` +#!/bin/bash + +api_key="<key>" +server_addr="<addr>" + +while IFS= read -r url; do + hoarder --api-key "$api_key" --server-addr "$server_addr" bookmarks add --link "$url" +done < all_links.txt +``` + ## Exporting Bookmarks from Chrome - Open Chrome and go to `chrome://bookmarks` |
