From e57937e118328a98d71325c536da1ee9e3537954 Mon Sep 17 00:00:00 2001 From: Bjorn Monnens Date: Sat, 9 Nov 2024 15:08:23 +0100 Subject: 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 --- docs/versioned_docs/version-v0.18.0/10-import.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs/versioned_docs/version-v0.18.0') 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 --server-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="" +server_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` -- cgit v1.2.3-70-g09d2