We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can consistently reproduce recursing into directories that don't exist from the root.
dropbox_uploader.sh download Personal/2011 > Downloading folder "/Personal/2011" to "./2011"... > /Personal/2011/folder1:folder; > Recursively downloading folder "/Personal/2011/folder1" to "./2011"... > Downloading folder "/Personal/2011/folder1" to "./2011/folder1"... > /Personal/2011/folder1:folder; > Recursively downloading folder "/Personal/2011/folder1/folder1" to "./2011/folder1"... > No such file or directory: /Personal/2011/folder1/folder1 > /Personal/2011/articles:folder; > Recursively downloading folder "/Personal/2011/folder1/articles" to "./2011/folder1"... > No such file or directory: /Personal/2011/folder1/articles > /Personal/2011/folder3:folder; > Recursively downloading folder "/Personal/2011/folder1/folder3" to "./2011/folder1"...
I tried to debug it, but wasn't able to fix. Reading from stdin recursively looks suspicious. Could behave differently on a mac?
full debug output
1.0 Darwin dblockdotorg.local 21.6.0 Darwin Kernel Version 21.6.0: Thu Mar 9 20:08:59 PST 2023; root:xnu-8020.240.18.700.8~1/RELEASE_X86_64 x86_64 + RESPONSE_FILE=/tmp/du_resp_debug + [[ '' == '' ]] + BIN_DEPS='sed basename date grep stat dd mkdir curl' + CURL_BIN=curl + which sed basename date grep stat dd mkdir curl + [[ 0 != 0 ]] + which readlink + [[ 0 == 0 ]] ++ readlink -m //test + [[ '' == \/\t\e\s\t ]] + HAVE_READLINK=0 + builtin printf '' + [[ 0 == 0 ]] + PRINTF='builtin printf' + PRINTF_OPT='-v o' + [[ -e /Users/dblock/.dropbox_uploader ]] + source /Users/dblock/.dropbox_uploader + [[ 2.0 != \2\.\0 ]] + [[ b9mc4fb5wn2h5mn = '' ]] + [[ 9grtbce73zupdm3 = '' ]] + [[ token = '' ]] + ensure_accesstoken ++ date +%s + local now=1686571865 + [[ '' > 1686571865 ]] + curl https://api.dropbox.com/oauth2/token -d grant_type=refresh_token -d refresh_token=token -u u:p -o /tmp/du_resp_debug + check_http_response + CODE=0 + case $CODE in + grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug ++ sed -n 's/.*"access_token": "\([^"]*\).*/\1/p' /tmp/du_resp_debug + OAUTH_ACCESS_TOKEN=auth ++ sed -n 's/.*"expires_in": \([0-9]*\).*/\1/p' /tmp/du_resp_debug + local expires_in=14400 + OAUTH_ACCESS_TOKEN_EXPIRE=1686586205 + COMMAND=download + ARG1=Personal/2011 + ARG2= + let argnum=3-2 + case $COMMAND in + [[ 1 -lt 1 ]] + FILE_SRC=Personal/2011 + FILE_DST= + db_download /Personal/2011 '' ++ normalize_path /Personal/2011 +++ builtin printf %s /Personal/2011 ++ path=/Personal/2011 ++ [[ 0 == 1 ]] ++ echo /Personal/2011 + local SRC=/Personal/2011 ++ normalize_path '' +++ builtin printf %s '' ++ path= ++ [[ 0 == 1 ]] ++ echo '' + local DST= ++ db_stat /Personal/2011 +++ normalize_path /Personal/2011 ++++ builtin printf %s /Personal/2011 +++ path=/Personal/2011 +++ [[ 0 == 1 ]] +++ echo /Personal/2011 ++ local FILE=/Personal/2011 ++ [[ /Personal/2011 == \/ ]] ++ ensure_accesstoken +++ date +%s ++ local now=1686571865 ++ [[ 1686586205 > 1686571865 ]] ++ return ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer auth' --header 'Content-Type: application/json' --data '{"path": "/Personal/2011"}' https://api.dropboxapi.com/2/files/get_metadata ++ check_http_response ++ CODE=0 ++ case $CODE in ++ grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug +++ sed -n 's/{".tag": *"*\([^"]*\)"*.*/\1/p' /tmp/du_resp_debug ++ local TYPE=folder ++ case $TYPE in ++ echo DIR + TYPE=DIR + [[ DIR == \D\I\R ]] + [[ '' == '' ]] + DST=. + [[ ! -d . ]] ++ basename /Personal/2011 + local basedir=2011 ++ normalize_path ./2011 +++ builtin printf %s ./2011 ++ path=./2011 ++ [[ 0 == 1 ]] ++ echo ./2011 + local DEST_DIR=./2011 + print ' > Downloading folder "/Personal/2011" to "./2011"... \n' + [[ 0 == 0 ]] + echo -ne ' > Downloading folder "/Personal/2011" to "./2011"... \n' > Downloading folder "/Personal/2011" to "./2011"... + [[ ! -d ./2011 ]] + [[ /Personal/2011 == \/ ]] + SRC_REQ=/Personal/2011 ++ db_list_outfile /Personal/2011 ++ local DIR_DST=/Personal/2011 ++ local HAS_MORE=false ++ local CURSOR= ++ [[ -n '' ]] ++ OUT_FILE=/tmp/du_tmp_out_23294 ++ true ++ [[ false == \t\r\u\e ]] ++ ensure_accesstoken +++ date +%s ++ local now=1686571866 ++ [[ 1686586205 > 1686571866 ]] ++ return ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer auth' --header 'Content-Type: application/json' --data '{"path": "/Personal/2011","include_media_info": false,"include_deleted": false,"include_has_explicit_shared_members": false}' https://api.dropboxapi.com/2/files/list_folder ++ check_http_response ++ CODE=0 ++ case $CODE in ++ grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug +++ sed -n 's/.*"has_more": *\([a-z]*\).*/\1/p' /tmp/du_resp_debug ++ HAS_MORE=false +++ sed -n 's/.*"cursor": *"\([^"]*\)".*/\1/p' /tmp/du_resp_debug ++ CURSOR=AAF-etX4bQFLPDi38Jjgq_PX3wDmjhFYcb9qyrUUvLDD-D78hd-obgn9aVvWupb0d3NFelnK0XtSWfVF4uDxl9YDnbRD4oAN_JCZt3Tmz2r63bqcr5J2tjJ6agQ0OGmnFsV6Xr4C-noLdOG3SMn9UAOqHblcn_NW9pghZ_k0aYeqHxP-M0iT6VYnvm__aMfm9H-A8WNG6Ihcx6civlptwSTzsCYGwS-FLLzUUsTq2H5IoQ ++ grep -q '^HTTP/[12].* 200' /tmp/du_resp_debug +++ sed -n 's/.*: \[{\(.*\)/\1/p' /tmp/du_resp_debug +++ sed 's/}, *{/}\ {/g' ++ local 'DIR_CONTENT=".tag": "folder", "name": "folder1", "path_lower": "/personal/2011/folder1", "path_display": "/Personal/2011/folder1", "id": "id:BuYGIrUIcGYAAAAAAAAP0w"} {".tag": "folder", "name": "articles", "path_lower": "/personal/2011/articles", "path_display": "/Personal/2011/articles", "id": "id:BuYGIrUIcGYAAAAAAAAP0g"} {".tag": "folder", "name": "folder3", "path_lower": "/personal/2011/folder3", "path_display": "/Personal/2011/folder3", "id": "id:BuYGIrUIcGYAAAAAAAAP0Q"} {".tag": "folder", "name": "ringtones", "path_lower": "/personal/2011/ringtones", "path_display": "/Personal/2011/ringtones", "id": "id:BuYGIrUIcGYAAAAAAAAP0A"} {".tag": "folder", "name": "open source", "path_lower": "/personal/2011/open source", "path_display": "/Personal/2011/open source", "id": "id:BuYGIrUIcGYAAAAAAAAPzw"} {".tag": "folder", "name": "Personal", "path_lower": "/personal/2011/personal", "path_display": "/Personal/2011/Personal", "id": "id:BuYGIrUIcGYAAAAAAAAPtg"} {".tag": "folder", "name": "classes", "path_lower": "/personal/2011/classes", "path_display": "/Personal/2011/classes", "id": "id:BuYGIrUIcGYAAAAAAAAQ7g"} {".tag": "folder", "name": "talks", "path_lower": "/personal/2011/talks", "path_display": "/Personal/2011/talks", "id": "id:BuYGIrUIcGYAAAAAAAAQtw"} {".tag": "folder", "name": "winhost", "path_lower": "/personal/2011/winhost", "path_display": "/Personal/2011/winhost", "id": "id:BuYGIrUIcGYAAAAAAAAQsw"} {".tag": "folder", "name": "nycto", "path_lower": "/personal/2011/nycto", "path_display": "/Personal/2011/nycto", "id": "id:BuYGIrUIcGYAAAAAAAAQVw"}], "cursor": "AAF-etX4bQFLPDi38Jjgq_PX3wDmjhFYcb9qyrUUvLDD-D78hd-obgn9aVvWupb0d3NFelnK0XtSWfVF4uDxl9YDnbRD4oAN_JCZt3Tmz2r63bqcr5J2tjJ6agQ0OGmnFsV6Xr4C-noLdOG3SMn9UAOqHblcn_NW9pghZ_k0aYeqHxP-M0iT6VYnvm__aMfm9H-A8WNG6Ihcx6civlptwSTzsCYGwS-FLLzUUsTq2H5IoQ", "has_more": false}' ++ echo '".tag": "folder", "name": "folder1", "path_lower": "/personal/2011/folder1", "path_display": "/Personal/2011/folder1", "id": "id:BuYGIrUIcGYAAAAAAAAP0w"} {".tag": "folder", "name": "articles", "path_lower": "/personal/2011/articles", "path_display": "/Personal/2011/articles", "id": "id:BuYGIrUIcGYAAAAAAAAP0g"} {".tag": "folder", "name": "folder3", "path_lower": "/personal/2011/folder3", "path_display": "/Personal/2011/folder3", "id": "id:BuYGIrUIcGYAAAAAAAAP0Q"} {".tag": "folder", "name": "ringtones", "path_lower": "/personal/2011/ringtones", "path_display": "/Personal/2011/ringtones", "id": "id:BuYGIrUIcGYAAAAAAAAP0A"} {".tag": "folder", "name": "open source", "path_lower": "/personal/2011/open source", "path_display": "/Personal/2011/open source", "id": "id:BuYGIrUIcGYAAAAAAAAPzw"} {".tag": "folder", "name": "Personal", "path_lower": "/personal/2011/personal", "path_display": "/Personal/2011/Personal", "id": "id:BuYGIrUIcGYAAAAAAAAPtg"} {".tag": "folder", "name": "classes", "path_lower": "/personal/2011/classes", "path_display": "/Personal/2011/classes", "id": "id:BuYGIrUIcGYAAAAAAAAQ7g"} {".tag": "folder", "name": "talks", "path_lower": "/personal/2011/talks", "path_display": "/Personal/2011/talks", "id": "id:BuYGIrUIcGYAAAAAAAAQtw"} {".tag": "folder", "name": "winhost", "path_lower": "/personal/2011/winhost", "path_display": "/Personal/2011/winhost", "id": "id:BuYGIrUIcGYAAAAAAAAQsw"} {".tag": "folder", "name": "nycto", "path_lower": "/personal/2011/nycto", "path_display": "/Personal/2011/nycto", "id": "id:BuYGIrUIcGYAAAAAAAAQVw"}], "cursor": "AAF-etX4bQFLPDi38Jjgq_PX3wDmjhFYcb9qyrUUvLDD-D78hd-obgn9aVvWupb0d3NFelnK0XtSWfVF4uDxl9YDnbRD4oAN_JCZt3Tmz2r63bqcr5J2tjJ6agQ0OGmnFsV6Xr4C-noLdOG3SMn9UAOqHblcn_NW9pghZ_k0aYeqHxP-M0iT6VYnvm__aMfm9H-A8WNG6Ihcx6civlptwSTzsCYGwS-FLLzUUsTq2H5IoQ", "has_more": false}' ++ sed 's/\\"/\\u0022/' ++ read -r line +++ echo '".tag": "folder", "name": "folder1", "path_lower": "/personal/2011/folder1", "path_display": "/Personal/2011/folder1", "id": "id:BuYGIrUIcGYAAAAAAAAP0w"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1 +++ echo '".tag": "folder", "name": "folder1", "path_lower": "/personal/2011/folder1", "path_display": "/Personal/2011/folder1", "id": "id:BuYGIrUIcGYAAAAAAAAP0w"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '".tag": "folder", "name": "folder1", "path_lower": "/personal/2011/folder1", "path_display": "/Personal/2011/folder1", "id": "id:BuYGIrUIcGYAAAAAAAAP0w"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "articles", "path_lower": "/personal/2011/articles", "path_display": "/Personal/2011/articles", "id": "id:BuYGIrUIcGYAAAAAAAAP0g"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/articles +++ echo '{".tag": "folder", "name": "articles", "path_lower": "/personal/2011/articles", "path_display": "/Personal/2011/articles", "id": "id:BuYGIrUIcGYAAAAAAAAP0g"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' ++++ echo '{".tag": "folder", "name": "articles", "path_lower": "/personal/2011/articles", "path_display": "/Personal/2011/articles", "id": "id:BuYGIrUIcGYAAAAAAAAP0g"}' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/articles:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "folder3", "path_lower": "/personal/2011/folder3", "path_display": "/Personal/2011/folder3", "id": "id:BuYGIrUIcGYAAAAAAAAP0Q"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder3 +++ echo '{".tag": "folder", "name": "folder3", "path_lower": "/personal/2011/folder3", "path_display": "/Personal/2011/folder3", "id": "id:BuYGIrUIcGYAAAAAAAAP0Q"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "folder3", "path_lower": "/personal/2011/folder3", "path_display": "/Personal/2011/folder3", "id": "id:BuYGIrUIcGYAAAAAAAAP0Q"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder3:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "ringtones", "path_lower": "/personal/2011/ringtones", "path_display": "/Personal/2011/ringtones", "id": "id:BuYGIrUIcGYAAAAAAAAP0A"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/ringtones +++ echo '{".tag": "folder", "name": "ringtones", "path_lower": "/personal/2011/ringtones", "path_display": "/Personal/2011/ringtones", "id": "id:BuYGIrUIcGYAAAAAAAAP0A"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "ringtones", "path_lower": "/personal/2011/ringtones", "path_display": "/Personal/2011/ringtones", "id": "id:BuYGIrUIcGYAAAAAAAAP0A"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/ringtones:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "open source", "path_lower": "/personal/2011/open source", "path_display": "/Personal/2011/open source", "id": "id:BuYGIrUIcGYAAAAAAAAPzw"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local 'FILE=/Personal/2011/open source' +++ echo '{".tag": "folder", "name": "open source", "path_lower": "/personal/2011/open source", "path_display": "/Personal/2011/open source", "id": "id:BuYGIrUIcGYAAAAAAAAPzw"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "open source", "path_lower": "/personal/2011/open source", "path_display": "/Personal/2011/open source", "id": "id:BuYGIrUIcGYAAAAAAAAPzw"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/open source:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "Personal", "path_lower": "/personal/2011/personal", "path_display": "/Personal/2011/Personal", "id": "id:BuYGIrUIcGYAAAAAAAAPtg"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/Personal +++ echo '{".tag": "folder", "name": "Personal", "path_lower": "/personal/2011/personal", "path_display": "/Personal/2011/Personal", "id": "id:BuYGIrUIcGYAAAAAAAAPtg"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "Personal", "path_lower": "/personal/2011/personal", "path_display": "/Personal/2011/Personal", "id": "id:BuYGIrUIcGYAAAAAAAAPtg"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/Personal:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "classes", "path_lower": "/personal/2011/classes", "path_display": "/Personal/2011/classes", "id": "id:BuYGIrUIcGYAAAAAAAAQ7g"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/classes +++ echo '{".tag": "folder", "name": "classes", "path_lower": "/personal/2011/classes", "path_display": "/Personal/2011/classes", "id": "id:BuYGIrUIcGYAAAAAAAAQ7g"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "classes", "path_lower": "/personal/2011/classes", "path_display": "/Personal/2011/classes", "id": "id:BuYGIrUIcGYAAAAAAAAQ7g"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/classes:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "talks", "path_lower": "/personal/2011/talks", "path_display": "/Personal/2011/talks", "id": "id:BuYGIrUIcGYAAAAAAAAQtw"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/talks +++ echo '{".tag": "folder", "name": "talks", "path_lower": "/personal/2011/talks", "path_display": "/Personal/2011/talks", "id": "id:BuYGIrUIcGYAAAAAAAAQtw"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "talks", "path_lower": "/personal/2011/talks", "path_display": "/Personal/2011/talks", "id": "id:BuYGIrUIcGYAAAAAAAAQtw"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/talks:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "winhost", "path_lower": "/personal/2011/winhost", "path_display": "/Personal/2011/winhost", "id": "id:BuYGIrUIcGYAAAAAAAAQsw"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/winhost +++ echo '{".tag": "folder", "name": "winhost", "path_lower": "/personal/2011/winhost", "path_display": "/Personal/2011/winhost", "id": "id:BuYGIrUIcGYAAAAAAAAQsw"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "winhost", "path_lower": "/personal/2011/winhost", "path_display": "/Personal/2011/winhost", "id": "id:BuYGIrUIcGYAAAAAAAAQsw"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/winhost:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "nycto", "path_lower": "/personal/2011/nycto", "path_display": "/Personal/2011/nycto", "id": "id:BuYGIrUIcGYAAAAAAAAQVw"}], "cursor": "AAF-etX4bQFLPDi38Jjgq_PX3wDmjhFYcb9qyrUUvLDD-D78hd-obgn9aVvWupb0d3NFelnK0XtSWfVF4uDxl9YDnbRD4oAN_JCZt3Tmz2r63bqcr5J2tjJ6agQ0OGmnFsV6Xr4C-noLdOG3SMn9UAOqHblcn_NW9pghZ_k0aYeqHxP-M0iT6VYnvm__aMfm9H-A8WNG6Ihcx6civlptwSTzsCYGwS-FLLzUUsTq2H5IoQ", "has_more": false}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/nycto +++ echo '{".tag": "folder", "name": "nycto", "path_lower": "/personal/2011/nycto", "path_display": "/Personal/2011/nycto", "id": "id:BuYGIrUIcGYAAAAAAAAQVw"}], "cursor": "AAF-etX4bQFLPDi38Jjgq_PX3wDmjhFYcb9qyrUUvLDD-D78hd-obgn9aVvWupb0d3NFelnK0XtSWfVF4uDxl9YDnbRD4oAN_JCZt3Tmz2r63bqcr5J2tjJ6agQ0OGmnFsV6Xr4C-noLdOG3SMn9UAOqHblcn_NW9pghZ_k0aYeqHxP-M0iT6VYnvm__aMfm9H-A8WNG6Ihcx6civlptwSTzsCYGwS-FLLzUUsTq2H5IoQ", "has_more": false}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "nycto", "path_lower": "/personal/2011/nycto", "path_display": "/Personal/2011/nycto", "id": "id:BuYGIrUIcGYAAAAAAAAQVw"}], "cursor": "AAF-etX4bQFLPDi38Jjgq_PX3wDmjhFYcb9qyrUUvLDD-D78hd-obgn9aVvWupb0d3NFelnK0XtSWfVF4uDxl9YDnbRD4oAN_JCZt3Tmz2r63bqcr5J2tjJ6agQ0OGmnFsV6Xr4C-noLdOG3SMn9UAOqHblcn_NW9pghZ_k0aYeqHxP-M0iT6VYnvm__aMfm9H-A8WNG6Ihcx6civlptwSTzsCYGwS-FLLzUUsTq2H5IoQ", "has_more": false}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/nycto:folder;' ++ read -r line ++ [[ false == \f\a\l\s\e ]] ++ break ++ echo /tmp/du_tmp_out_23294 + OUT_FILE=/tmp/du_tmp_out_23294 + '[' 0 -ne 0 ']' + read -r line + local FILE=/Personal/2011/folder1 + local 'META=folder;' + local TYPE=folder + local SIZE= + FILE=folder1 + [[ folder == \f\i\l\e ]] + [[ folder == \f\o\l\d\e\r ]] + db_download /Personal/2011/folder1 ./2011 ++ normalize_path /Personal/2011/folder1 +++ builtin printf %s /Personal/2011/folder1 ++ path=/Personal/2011/folder1 ++ [[ 0 == 1 ]] ++ echo /Personal/2011/folder1 + local SRC=/Personal/2011/folder1 ++ normalize_path ./2011 +++ builtin printf %s ./2011 ++ path=./2011 ++ [[ 0 == 1 ]] ++ echo ./2011 + local DST=./2011 ++ db_stat /Personal/2011/folder1 +++ normalize_path /Personal/2011/folder1 ++++ builtin printf %s /Personal/2011/folder1 +++ path=/Personal/2011/folder1 +++ [[ 0 == 1 ]] +++ echo /Personal/2011/folder1 ++ local FILE=/Personal/2011/folder1 ++ [[ /Personal/2011/folder1 == \/ ]] ++ ensure_accesstoken +++ date +%s ++ local now=1686571866 ++ [[ 1686586205 > 1686571866 ]] ++ return ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer auth' --header 'Content-Type: application/json' --data '{"path": "/Personal/2011/folder1"}' https://api.dropboxapi.com/2/files/get_metadata ++ check_http_response ++ CODE=0 ++ case $CODE in ++ grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug +++ sed -n 's/{".tag": *"*\([^"]*\)"*.*/\1/p' /tmp/du_resp_debug ++ local TYPE=folder ++ case $TYPE in ++ echo DIR + TYPE=DIR + [[ DIR == \D\I\R ]] + [[ ./2011 == '' ]] + [[ ! -d ./2011 ]] ++ basename /Personal/2011/folder1 + local basedir=folder1 ++ normalize_path ./2011/folder1 +++ builtin printf %s ./2011/folder1 ++ path=./2011/folder1 ++ [[ 0 == 1 ]] ++ echo ./2011/folder1 + local DEST_DIR=./2011/folder1 + print ' > Downloading folder "/Personal/2011/folder1" to "./2011/folder1"... \n' + [[ 0 == 0 ]] + echo -ne ' > Downloading folder "/Personal/2011/folder1" to "./2011/folder1"... \n' > Downloading folder "/Personal/2011/folder1" to "./2011/folder1"... + [[ ! -d ./2011/folder1 ]] + [[ /Personal/2011/folder1 == \/ ]] + SRC_REQ=/Personal/2011/folder1 ++ db_list_outfile /Personal/2011/folder1 ++ local DIR_DST=/Personal/2011/folder1 ++ local HAS_MORE=false ++ local CURSOR= ++ [[ -n '' ]] ++ OUT_FILE=/tmp/du_tmp_out_23294 ++ true ++ [[ false == \t\r\u\e ]] ++ ensure_accesstoken +++ date +%s ++ local now=1686571867 ++ [[ 1686586205 > 1686571867 ]] ++ return ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer auth' --header 'Content-Type: application/json' --data '{"path": "/Personal/2011/folder1","include_media_info": false,"include_deleted": false,"include_has_explicit_shared_members": false}' https://api.dropboxapi.com/2/files/list_folder ++ check_http_response ++ CODE=0 ++ case $CODE in ++ grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug +++ sed -n 's/.*"has_more": *\([a-z]*\).*/\1/p' /tmp/du_resp_debug ++ HAS_MORE=false +++ sed -n 's/.*"cursor": *"\([^"]*\)".*/\1/p' /tmp/du_resp_debug ++ CURSOR=AAGNztO452Nid4CENQzD4mHt9oEcwNDa4-HPxCnoFUR9Wcab-7sDKKzfcJyFrLVoDKp4YED02XLEZNvBZHvncUZRnOec6ARurs-vJhF-0kQ2LaUj_HFYoza5Rp-wxVBCr3h092_1f2af50AqlZ5ikO478An1kRU034o1Ef3f44pk93ow_axSFlbECw1sg78WE9ml1HVd2-RwpvOBEyNyRyQuoD7wz2A6NNipQeh0a08Ivu1oC2Fh3hOQ-1tVyMk36kw ++ grep -q '^HTTP/[12].* 200' /tmp/du_resp_debug +++ sed -n 's/.*: \[{\(.*\)/\1/p' /tmp/du_resp_debug +++ sed 's/}, *{/}\ {/g' ++ local 'DIR_CONTENT=".tag": "folder", "name": "scrum", "path_lower": "/personal/2011/folder1/scrum", "path_display": "/Personal/2011/folder1/scrum", "id": "id:BuYGIrUIcGYAAAAAAAAPzg"} {".tag": "folder", "name": "search", "path_lower": "/personal/2011/folder1/search", "path_display": "/Personal/2011/folder1/search", "id": "id:BuYGIrUIcGYAAAAAAAAPyw"} {".tag": "folder", "name": "folder2", "path_lower": "/personal/2011/folder1/folder2", "path_display": "/Personal/2011/folder1/folder2", "id": "id:BuYGIrUIcGYAAAAAAAAPyg"} {".tag": "folder", "name": "benefits", "path_lower": "/personal/2011/folder1/benefits", "path_display": "/Personal/2011/folder1/benefits", "id": "id:BuYGIrUIcGYAAAAAAAAPyQ"} {".tag": "folder", "name": "galleries", "path_lower": "/personal/2011/folder1/galleries", "path_display": "/Personal/2011/folder1/galleries", "id": "id:BuYGIrUIcGYAAAAAAAAPxw"} {".tag": "folder", "name": "interviewing", "path_lower": "/personal/2011/folder1/interviewing", "path_display": "/Personal/2011/folder1/interviewing", "id": "id:BuYGIrUIcGYAAAAAAAAPxQ"} {".tag": "folder", "name": "Keys", "path_lower": "/personal/2011/folder1/keys", "path_display": "/Personal/2011/folder1/Keys", "id": "id:BuYGIrUIcGYAAAAAAAAPpw"} {".tag": "folder", "name": "Legal", "path_lower": "/personal/2011/folder1/legal", "path_display": "/Personal/2011/folder1/Legal", "id": "id:BuYGIrUIcGYAAAAAAAAPow"} {".tag": "folder", "name": "expenses", "path_lower": "/personal/2011/folder1/expenses", "path_display": "/Personal/2011/folder1/expenses", "id": "id:BuYGIrUIcGYAAAAAAAAPeA"} {".tag": "folder", "name": "art", "path_lower": "/personal/2011/folder1/art", "path_display": "/Personal/2011/folder1/art", "id": "id:BuYGIrUIcGYAAAAAAAAQ3g"} {".tag": "folder", "name": "ppt", "path_lower": "/personal/2011/folder1/ppt", "path_display": "/Personal/2011/folder1/ppt", "id": "id:BuYGIrUIcGYAAAAAAAAQTA"} {".tag": "folder", "name": "shows", "path_lower": "/personal/2011/folder1/shows", "path_display": "/Personal/2011/folder1/shows", "id": "id:BuYGIrUIcGYAAAAAAAARsQ"} {".tag": "folder", "name": "press", "path_lower": "/personal/2011/folder1/press", "path_display": "/Personal/2011/folder1/press", "id": "id:BuYGIrUIcGYAAAAAAAARsA"} {".tag": "folder", "name": "magic", "path_lower": "/personal/2011/folder1/magic", "path_display": "/Personal/2011/folder1/magic", "id": "id:BuYGIrUIcGYAAAAAAAAktw"} {".tag": "folder", "name": "gource", "path_lower": "/personal/2011/folder1/gource", "path_display": "/Personal/2011/folder1/gource", "id": "id:BuYGIrUIcGYAAAAAAApi0w"} {".tag": "file", "name": "Early Artsy.png", "path_lower": "/personal/2011/folder1/early artsy.png", "path_display": "/Personal/2011/folder1/Early Artsy.png", "id": "id:BuYGIrUIcGYAAAAAAAymKA", "client_modified": "2018-02-12T22:19:33Z", "server_modified": "2018-02-12T22:19:33Z", "rev": "168b2c0067c20b", "size": 2250903, "is_downloadable": true, "content_hash": "3a43d7e50f244b98d1b9596955a7195d2773cf4db26a9149a0093baaf1fe3347"}], "cursor": "AAGNztO452Nid4CENQzD4mHt9oEcwNDa4-HPxCnoFUR9Wcab-7sDKKzfcJyFrLVoDKp4YED02XLEZNvBZHvncUZRnOec6ARurs-vJhF-0kQ2LaUj_HFYoza5Rp-wxVBCr3h092_1f2af50AqlZ5ikO478An1kRU034o1Ef3f44pk93ow_axSFlbECw1sg78WE9ml1HVd2-RwpvOBEyNyRyQuoD7wz2A6NNipQeh0a08Ivu1oC2Fh3hOQ-1tVyMk36kw", "has_more": false}' ++ echo '".tag": "folder", "name": "scrum", "path_lower": "/personal/2011/folder1/scrum", "path_display": "/Personal/2011/folder1/scrum", "id": "id:BuYGIrUIcGYAAAAAAAAPzg"} {".tag": "folder", "name": "search", "path_lower": "/personal/2011/folder1/search", "path_display": "/Personal/2011/folder1/search", "id": "id:BuYGIrUIcGYAAAAAAAAPyw"} {".tag": "folder", "name": "folder2", "path_lower": "/personal/2011/folder1/folder2", "path_display": "/Personal/2011/folder1/folder2", "id": "id:BuYGIrUIcGYAAAAAAAAPyg"} {".tag": "folder", "name": "benefits", "path_lower": "/personal/2011/folder1/benefits", "path_display": "/Personal/2011/folder1/benefits", "id": "id:BuYGIrUIcGYAAAAAAAAPyQ"} {".tag": "folder", "name": "galleries", "path_lower": "/personal/2011/folder1/galleries", "path_display": "/Personal/2011/folder1/galleries", "id": "id:BuYGIrUIcGYAAAAAAAAPxw"} {".tag": "folder", "name": "interviewing", "path_lower": "/personal/2011/folder1/interviewing", "path_display": "/Personal/2011/folder1/interviewing", "id": "id:BuYGIrUIcGYAAAAAAAAPxQ"} {".tag": "folder", "name": "Keys", "path_lower": "/personal/2011/folder1/keys", "path_display": "/Personal/2011/folder1/Keys", "id": "id:BuYGIrUIcGYAAAAAAAAPpw"} {".tag": "folder", "name": "Legal", "path_lower": "/personal/2011/folder1/legal", "path_display": "/Personal/2011/folder1/Legal", "id": "id:BuYGIrUIcGYAAAAAAAAPow"} {".tag": "folder", "name": "expenses", "path_lower": "/personal/2011/folder1/expenses", "path_display": "/Personal/2011/folder1/expenses", "id": "id:BuYGIrUIcGYAAAAAAAAPeA"} {".tag": "folder", "name": "art", "path_lower": "/personal/2011/folder1/art", "path_display": "/Personal/2011/folder1/art", "id": "id:BuYGIrUIcGYAAAAAAAAQ3g"} {".tag": "folder", "name": "ppt", "path_lower": "/personal/2011/folder1/ppt", "path_display": "/Personal/2011/folder1/ppt", "id": "id:BuYGIrUIcGYAAAAAAAAQTA"} {".tag": "folder", "name": "shows", "path_lower": "/personal/2011/folder1/shows", "path_display": "/Personal/2011/folder1/shows", "id": "id:BuYGIrUIcGYAAAAAAAARsQ"} {".tag": "folder", "name": "press", "path_lower": "/personal/2011/folder1/press", "path_display": "/Personal/2011/folder1/press", "id": "id:BuYGIrUIcGYAAAAAAAARsA"} {".tag": "folder", "name": "magic", "path_lower": "/personal/2011/folder1/magic", "path_display": "/Personal/2011/folder1/magic", "id": "id:BuYGIrUIcGYAAAAAAAAktw"} {".tag": "folder", "name": "gource", "path_lower": "/personal/2011/folder1/gource", "path_display": "/Personal/2011/folder1/gource", "id": "id:BuYGIrUIcGYAAAAAAApi0w"} {".tag": "file", "name": "Early Artsy.png", "path_lower": "/personal/2011/folder1/early artsy.png", "path_display": "/Personal/2011/folder1/Early Artsy.png", "id": "id:BuYGIrUIcGYAAAAAAAymKA", "client_modified": "2018-02-12T22:19:33Z", "server_modified": "2018-02-12T22:19:33Z", "rev": "168b2c0067c20b", "size": 2250903, "is_downloadable": true, "content_hash": "3a43d7e50f244b98d1b9596955a7195d2773cf4db26a9149a0093baaf1fe3347"}], "cursor": "AAGNztO452Nid4CENQzD4mHt9oEcwNDa4-HPxCnoFUR9Wcab-7sDKKzfcJyFrLVoDKp4YED02XLEZNvBZHvncUZRnOec6ARurs-vJhF-0kQ2LaUj_HFYoza5Rp-wxVBCr3h092_1f2af50AqlZ5ikO478An1kRU034o1Ef3f44pk93ow_axSFlbECw1sg78WE9ml1HVd2-RwpvOBEyNyRyQuoD7wz2A6NNipQeh0a08Ivu1oC2Fh3hOQ-1tVyMk36kw", "has_more": false}' ++ sed 's/\\"/\\u0022/' ++ read -r line +++ echo '".tag": "folder", "name": "scrum", "path_lower": "/personal/2011/folder1/scrum", "path_display": "/Personal/2011/folder1/scrum", "id": "id:BuYGIrUIcGYAAAAAAAAPzg"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/scrum +++ echo '".tag": "folder", "name": "scrum", "path_lower": "/personal/2011/folder1/scrum", "path_display": "/Personal/2011/folder1/scrum", "id": "id:BuYGIrUIcGYAAAAAAAAPzg"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '".tag": "folder", "name": "scrum", "path_lower": "/personal/2011/folder1/scrum", "path_display": "/Personal/2011/folder1/scrum", "id": "id:BuYGIrUIcGYAAAAAAAAPzg"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/scrum:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "search", "path_lower": "/personal/2011/folder1/search", "path_display": "/Personal/2011/folder1/search", "id": "id:BuYGIrUIcGYAAAAAAAAPyw"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/search +++ echo '{".tag": "folder", "name": "search", "path_lower": "/personal/2011/folder1/search", "path_display": "/Personal/2011/folder1/search", "id": "id:BuYGIrUIcGYAAAAAAAAPyw"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "search", "path_lower": "/personal/2011/folder1/search", "path_display": "/Personal/2011/folder1/search", "id": "id:BuYGIrUIcGYAAAAAAAAPyw"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/search:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "folder2", "path_lower": "/personal/2011/folder1/folder2", "path_display": "/Personal/2011/folder1/folder2", "id": "id:BuYGIrUIcGYAAAAAAAAPyg"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/folder2 +++ echo '{".tag": "folder", "name": "folder2", "path_lower": "/personal/2011/folder1/folder2", "path_display": "/Personal/2011/folder1/folder2", "id": "id:BuYGIrUIcGYAAAAAAAAPyg"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "folder2", "path_lower": "/personal/2011/folder1/folder2", "path_display": "/Personal/2011/folder1/folder2", "id": "id:BuYGIrUIcGYAAAAAAAAPyg"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/folder2:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "benefits", "path_lower": "/personal/2011/folder1/benefits", "path_display": "/Personal/2011/folder1/benefits", "id": "id:BuYGIrUIcGYAAAAAAAAPyQ"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/benefits +++ echo '{".tag": "folder", "name": "benefits", "path_lower": "/personal/2011/folder1/benefits", "path_display": "/Personal/2011/folder1/benefits", "id": "id:BuYGIrUIcGYAAAAAAAAPyQ"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "benefits", "path_lower": "/personal/2011/folder1/benefits", "path_display": "/Personal/2011/folder1/benefits", "id": "id:BuYGIrUIcGYAAAAAAAAPyQ"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/benefits:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "galleries", "path_lower": "/personal/2011/folder1/galleries", "path_display": "/Personal/2011/folder1/galleries", "id": "id:BuYGIrUIcGYAAAAAAAAPxw"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/galleries +++ echo '{".tag": "folder", "name": "galleries", "path_lower": "/personal/2011/folder1/galleries", "path_display": "/Personal/2011/folder1/galleries", "id": "id:BuYGIrUIcGYAAAAAAAAPxw"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "galleries", "path_lower": "/personal/2011/folder1/galleries", "path_display": "/Personal/2011/folder1/galleries", "id": "id:BuYGIrUIcGYAAAAAAAAPxw"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/galleries:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "interviewing", "path_lower": "/personal/2011/folder1/interviewing", "path_display": "/Personal/2011/folder1/interviewing", "id": "id:BuYGIrUIcGYAAAAAAAAPxQ"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/interviewing +++ echo '{".tag": "folder", "name": "interviewing", "path_lower": "/personal/2011/folder1/interviewing", "path_display": "/Personal/2011/folder1/interviewing", "id": "id:BuYGIrUIcGYAAAAAAAAPxQ"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "interviewing", "path_lower": "/personal/2011/folder1/interviewing", "path_display": "/Personal/2011/folder1/interviewing", "id": "id:BuYGIrUIcGYAAAAAAAAPxQ"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/interviewing:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "Keys", "path_lower": "/personal/2011/folder1/keys", "path_display": "/Personal/2011/folder1/Keys", "id": "id:BuYGIrUIcGYAAAAAAAAPpw"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/Keys +++ echo '{".tag": "folder", "name": "Keys", "path_lower": "/personal/2011/folder1/keys", "path_display": "/Personal/2011/folder1/Keys", "id": "id:BuYGIrUIcGYAAAAAAAAPpw"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "Keys", "path_lower": "/personal/2011/folder1/keys", "path_display": "/Personal/2011/folder1/Keys", "id": "id:BuYGIrUIcGYAAAAAAAAPpw"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/Keys:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "Legal", "path_lower": "/personal/2011/folder1/legal", "path_display": "/Personal/2011/folder1/Legal", "id": "id:BuYGIrUIcGYAAAAAAAAPow"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/Legal +++ echo '{".tag": "folder", "name": "Legal", "path_lower": "/personal/2011/folder1/legal", "path_display": "/Personal/2011/folder1/Legal", "id": "id:BuYGIrUIcGYAAAAAAAAPow"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "Legal", "path_lower": "/personal/2011/folder1/legal", "path_display": "/Personal/2011/folder1/Legal", "id": "id:BuYGIrUIcGYAAAAAAAAPow"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/Legal:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "expenses", "path_lower": "/personal/2011/folder1/expenses", "path_display": "/Personal/2011/folder1/expenses", "id": "id:BuYGIrUIcGYAAAAAAAAPeA"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/expenses +++ echo '{".tag": "folder", "name": "expenses", "path_lower": "/personal/2011/folder1/expenses", "path_display": "/Personal/2011/folder1/expenses", "id": "id:BuYGIrUIcGYAAAAAAAAPeA"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "expenses", "path_lower": "/personal/2011/folder1/expenses", "path_display": "/Personal/2011/folder1/expenses", "id": "id:BuYGIrUIcGYAAAAAAAAPeA"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/expenses:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "art", "path_lower": "/personal/2011/folder1/art", "path_display": "/Personal/2011/folder1/art", "id": "id:BuYGIrUIcGYAAAAAAAAQ3g"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/art +++ echo '{".tag": "folder", "name": "art", "path_lower": "/personal/2011/folder1/art", "path_display": "/Personal/2011/folder1/art", "id": "id:BuYGIrUIcGYAAAAAAAAQ3g"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "art", "path_lower": "/personal/2011/folder1/art", "path_display": "/Personal/2011/folder1/art", "id": "id:BuYGIrUIcGYAAAAAAAAQ3g"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/art:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "ppt", "path_lower": "/personal/2011/folder1/ppt", "path_display": "/Personal/2011/folder1/ppt", "id": "id:BuYGIrUIcGYAAAAAAAAQTA"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/ppt +++ echo '{".tag": "folder", "name": "ppt", "path_lower": "/personal/2011/folder1/ppt", "path_display": "/Personal/2011/folder1/ppt", "id": "id:BuYGIrUIcGYAAAAAAAAQTA"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "ppt", "path_lower": "/personal/2011/folder1/ppt", "path_display": "/Personal/2011/folder1/ppt", "id": "id:BuYGIrUIcGYAAAAAAAAQTA"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/ppt:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "shows", "path_lower": "/personal/2011/folder1/shows", "path_display": "/Personal/2011/folder1/shows", "id": "id:BuYGIrUIcGYAAAAAAAARsQ"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/shows +++ echo '{".tag": "folder", "name": "shows", "path_lower": "/personal/2011/folder1/shows", "path_display": "/Personal/2011/folder1/shows", "id": "id:BuYGIrUIcGYAAAAAAAARsQ"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "shows", "path_lower": "/personal/2011/folder1/shows", "path_display": "/Personal/2011/folder1/shows", "id": "id:BuYGIrUIcGYAAAAAAAARsQ"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/shows:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "press", "path_lower": "/personal/2011/folder1/press", "path_display": "/Personal/2011/folder1/press", "id": "id:BuYGIrUIcGYAAAAAAAARsA"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/press +++ echo '{".tag": "folder", "name": "press", "path_lower": "/personal/2011/folder1/press", "path_display": "/Personal/2011/folder1/press", "id": "id:BuYGIrUIcGYAAAAAAAARsA"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "press", "path_lower": "/personal/2011/folder1/press", "path_display": "/Personal/2011/folder1/press", "id": "id:BuYGIrUIcGYAAAAAAAARsA"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/press:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "magic", "path_lower": "/personal/2011/folder1/magic", "path_display": "/Personal/2011/folder1/magic", "id": "id:BuYGIrUIcGYAAAAAAAAktw"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/magic +++ echo '{".tag": "folder", "name": "magic", "path_lower": "/personal/2011/folder1/magic", "path_display": "/Personal/2011/folder1/magic", "id": "id:BuYGIrUIcGYAAAAAAAAktw"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "magic", "path_lower": "/personal/2011/folder1/magic", "path_display": "/Personal/2011/folder1/magic", "id": "id:BuYGIrUIcGYAAAAAAAAktw"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/magic:folder;' ++ read -r line +++ echo '{".tag": "folder", "name": "gource", "path_lower": "/personal/2011/folder1/gource", "path_display": "/Personal/2011/folder1/gource", "id": "id:BuYGIrUIcGYAAAAAAApi0w"}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local FILE=/Personal/2011/folder1/gource +++ echo '{".tag": "folder", "name": "gource", "path_lower": "/personal/2011/folder1/gource", "path_display": "/Personal/2011/folder1/gource", "id": "id:BuYGIrUIcGYAAAAAAApi0w"}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=folder ++++ echo '{".tag": "folder", "name": "gource", "path_lower": "/personal/2011/folder1/gource", "path_display": "/Personal/2011/folder1/gource", "id": "id:BuYGIrUIcGYAAAAAAApi0w"}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes +++ [[ '' == 1 ]] +++ echo ++ local SIZE= ++ echo -e '/Personal/2011/folder1/gource:folder;' ++ read -r line +++ echo '{".tag": "file", "name": "Early Artsy.png", "path_lower": "/personal/2011/folder1/early artsy.png", "path_display": "/Personal/2011/folder1/Early Artsy.png", "id": "id:BuYGIrUIcGYAAAAAAAymKA", "client_modified": "2018-02-12T22:19:33Z", "server_modified": "2018-02-12T22:19:33Z", "rev": "168b2c0067c20b", "size": 2250903, "is_downloadable": true, "content_hash": "3a43d7e50f244b98d1b9596955a7195d2773cf4db26a9149a0093baaf1fe3347"}], "cursor": "AAGNztO452Nid4CENQzD4mHt9oEcwNDa4-HPxCnoFUR9Wcab-7sDKKzfcJyFrLVoDKp4YED02XLEZNvBZHvncUZRnOec6ARurs-vJhF-0kQ2LaUj_HFYoza5Rp-wxVBCr3h092_1f2af50AqlZ5ikO478An1kRU034o1Ef3f44pk93ow_axSFlbECw1sg78WE9ml1HVd2-RwpvOBEyNyRyQuoD7wz2A6NNipQeh0a08Ivu1oC2Fh3hOQ-1tVyMk36kw", "has_more": false}' +++ sed -n 's/.*"path_display": *"\([^"]*\)".*/\1/p' ++ local 'FILE=/Personal/2011/folder1/Early Artsy.png' +++ echo '{".tag": "file", "name": "Early Artsy.png", "path_lower": "/personal/2011/folder1/early artsy.png", "path_display": "/Personal/2011/folder1/Early Artsy.png", "id": "id:BuYGIrUIcGYAAAAAAAymKA", "client_modified": "2018-02-12T22:19:33Z", "server_modified": "2018-02-12T22:19:33Z", "rev": "168b2c0067c20b", "size": 2250903, "is_downloadable": true, "content_hash": "3a43d7e50f244b98d1b9596955a7195d2773cf4db26a9149a0093baaf1fe3347"}], "cursor": "AAGNztO452Nid4CENQzD4mHt9oEcwNDa4-HPxCnoFUR9Wcab-7sDKKzfcJyFrLVoDKp4YED02XLEZNvBZHvncUZRnOec6ARurs-vJhF-0kQ2LaUj_HFYoza5Rp-wxVBCr3h092_1f2af50AqlZ5ikO478An1kRU034o1Ef3f44pk93ow_axSFlbECw1sg78WE9ml1HVd2-RwpvOBEyNyRyQuoD7wz2A6NNipQeh0a08Ivu1oC2Fh3hOQ-1tVyMk36kw", "has_more": false}' +++ sed -n 's/.*".tag": *"\([^"]*\).*/\1/p' ++ local TYPE=file ++++ echo '{".tag": "file", "name": "Early Artsy.png", "path_lower": "/personal/2011/folder1/early artsy.png", "path_display": "/Personal/2011/folder1/Early Artsy.png", "id": "id:BuYGIrUIcGYAAAAAAAymKA", "client_modified": "2018-02-12T22:19:33Z", "server_modified": "2018-02-12T22:19:33Z", "rev": "168b2c0067c20b", "size": 2250903, "is_downloadable": true, "content_hash": "3a43d7e50f244b98d1b9596955a7195d2773cf4db26a9149a0093baaf1fe3347"}], "cursor": "AAGNztO452Nid4CENQzD4mHt9oEcwNDa4-HPxCnoFUR9Wcab-7sDKKzfcJyFrLVoDKp4YED02XLEZNvBZHvncUZRnOec6ARurs-vJhF-0kQ2LaUj_HFYoza5Rp-wxVBCr3h092_1f2af50AqlZ5ikO478An1kRU034o1Ef3f44pk93ow_axSFlbECw1sg78WE9ml1HVd2-RwpvOBEyNyRyQuoD7wz2A6NNipQeh0a08Ivu1oC2Fh3hOQ-1tVyMk36kw", "has_more": false}' ++++ sed -n 's/.*"size": *\([0-9]*\).*/\1/p' +++ convert_bytes 2250903 +++ [[ '' == 1 ]] +++ echo 2250903 ++ local SIZE=2250903 ++ echo -e '/Personal/2011/folder1/Early Artsy.png:file;2250903' ++ read -r line ++ [[ false == \f\a\l\s\e ]] ++ break ++ echo /tmp/du_tmp_out_23294 + OUT_FILE=/tmp/du_tmp_out_23294 + '[' 0 -ne 0 ']' + read -r line + local FILE=/Personal/2011/folder1 + local 'META=folder;' + local TYPE=folder + local SIZE= + FILE=folder1 + [[ folder == \f\i\l\e ]] + [[ folder == \f\o\l\d\e\r ]] + db_download /Personal/2011/folder1/folder1 ./2011/folder1 ++ normalize_path /Personal/2011/folder1/folder1 +++ builtin printf %s /Personal/2011/folder1/folder1 ++ path=/Personal/2011/folder1/folder1 ++ [[ 0 == 1 ]] ++ echo /Personal/2011/folder1/folder1 + local SRC=/Personal/2011/folder1/folder1 ++ normalize_path ./2011/folder1 +++ builtin printf %s ./2011/folder1 ++ path=./2011/folder1 ++ [[ 0 == 1 ]] ++ echo ./2011/folder1 + local DST=./2011/folder1 ++ db_stat /Personal/2011/folder1/folder1 +++ normalize_path /Personal/2011/folder1/folder1 ++++ builtin printf %s /Personal/2011/folder1/folder1 +++ path=/Personal/2011/folder1/folder1 +++ [[ 0 == 1 ]] +++ echo /Personal/2011/folder1/folder1 ++ local FILE=/Personal/2011/folder1/folder1 ++ [[ /Personal/2011/folder1/folder1 == \/ ]] ++ ensure_accesstoken +++ date +%s ++ local now=1686571868 ++ [[ 1686586205 > 1686571868 ]] ++ return ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer auth' --header 'Content-Type: application/json' --data '{"path": "/Personal/2011/folder1/folder1"}' https://api.dropboxapi.com/2/files/get_metadata ++ check_http_response ++ CODE=0 ++ case $CODE in ++ grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug +++ sed -n 's/{".tag": *"*\([^"]*\)"*.*/\1/p' /tmp/du_resp_debug ++ local 'TYPE={"error_summary": "path/not_found/", "error": path' ++ case $TYPE in ++ echo ERR + TYPE=ERR + [[ ERR == \D\I\R ]] + [[ ERR == \F\I\L\E ]] + print ' > No such file or directory: /Personal/2011/folder1/folder1\n' + [[ 0 == 0 ]] + echo -ne ' > No such file or directory: /Personal/2011/folder1/folder1\n' > No such file or directory: /Personal/2011/folder1/folder1 + ERROR_STATUS=1 + return + read -r line + local FILE=/Personal/2011/articles + local 'META=folder;' + local TYPE=folder + local SIZE= + FILE=articles + [[ folder == \f\i\l\e ]] + [[ folder == \f\o\l\d\e\r ]] + db_download /Personal/2011/folder1/articles ./2011/folder1 ++ normalize_path /Personal/2011/folder1/articles +++ builtin printf %s /Personal/2011/folder1/articles ++ path=/Personal/2011/folder1/articles ++ [[ 0 == 1 ]] ++ echo /Personal/2011/folder1/articles + local SRC=/Personal/2011/folder1/articles ++ normalize_path ./2011/folder1 +++ builtin printf %s ./2011/folder1 ++ path=./2011/folder1 ++ [[ 0 == 1 ]] ++ echo ./2011/folder1 + local DST=./2011/folder1 ++ db_stat /Personal/2011/folder1/articles +++ normalize_path /Personal/2011/folder1/articles ++++ builtin printf %s /Personal/2011/folder1/articles +++ path=/Personal/2011/folder1/articles +++ [[ 0 == 1 ]] +++ echo /Personal/2011/folder1/articles ++ local FILE=/Personal/2011/folder1/articles ++ [[ /Personal/2011/folder1/articles == \/ ]] ++ ensure_accesstoken +++ date +%s ++ local now=1686571868 ++ [[ 1686586205 > 1686571868 ]] ++ return ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer auth' --header 'Content-Type: application/json' --data '{"path": "/Personal/2011/folder1/articles"}' https://api.dropboxapi.com/2/files/get_metadata ++ check_http_response ++ CODE=0 ++ case $CODE in ++ grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug +++ sed -n 's/{".tag": *"*\([^"]*\)"*.*/\1/p' /tmp/du_resp_debug ++ local 'TYPE={"error_summary": "path/not_found/.", "error": path' ++ case $TYPE in ++ echo ERR + TYPE=ERR + [[ ERR == \D\I\R ]] + [[ ERR == \F\I\L\E ]] + print ' > No such file or directory: /Personal/2011/folder1/articles\n' + [[ 0 == 0 ]] + echo -ne ' > No such file or directory: /Personal/2011/folder1/articles\n' > No such file or directory: /Personal/2011/folder1/articles + ERROR_STATUS=1 + return + read -r line + local FILE=/Personal/2011/folder3 + local 'META=folder;' + local TYPE=folder + local SIZE= + FILE=folder3 + [[ folder == \f\i\l\e ]] + [[ folder == \f\o\l\d\e\r ]] + db_download /Personal/2011/folder1/folder3 ./2011/folder1 ++ normalize_path /Personal/2011/folder1/folder3 +++ builtin printf %s /Personal/2011/folder1/folder3 ++ path=/Personal/2011/folder1/folder3 ++ [[ 0 == 1 ]] ++ echo /Personal/2011/folder1/folder3 + local SRC=/Personal/2011/folder1/folder3 ++ normalize_path ./2011/folder1 +++ builtin printf %s ./2011/folder1 ++ path=./2011/folder1 ++ [[ 0 == 1 ]] ++ echo ./2011/folder1 + local DST=./2011/folder1 ++ db_stat /Personal/2011/folder1/folder3 +++ normalize_path /Personal/2011/folder1/folder3 ++++ builtin printf %s /Personal/2011/folder1/folder3 +++ path=/Personal/2011/folder1/folder3 +++ [[ 0 == 1 ]] +++ echo /Personal/2011/folder1/folder3 ++ local FILE=/Personal/2011/folder1/folder3 ++ [[ /Personal/2011/folder1/folder3 == \/ ]] ++ ensure_accesstoken +++ date +%s ++ local now=1686571869 ++ [[ 1686586205 > 1686571869 ]] ++ return ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer auth' --header 'Content-Type: application/json' --data '{"path": "/Personal/2011/folder1/folder3"}' https://api.dropboxapi.com/2/files/get_metadata ++ check_http_response ++ CODE=0 ++ case $CODE in ++ grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug +++ sed -n 's/{".tag": *"*\([^"]*\)"*.*/\1/p' /tmp/du_resp_debug ++ local 'TYPE={"error_summary": "path/not_found/.", "error": path' ++ case $TYPE in ++ echo ERR + TYPE=ERR + [[ ERR == \D\I\R ]] + [[ ERR == \F\I\L\E ]] + print ' > No such file or directory: /Personal/2011/folder1/folder3\n' + [[ 0 == 0 ]] + echo -ne ' > No such file or directory: /Personal/2011/folder1/folder3\n' > No such file or directory: /Personal/2011/folder1/folder3 + ERROR_STATUS=1 + return + read -r line + local FILE=/Personal/2011/ringtones + local 'META=folder;' + local TYPE=folder + local SIZE= + FILE=ringtones + [[ folder == \f\i\l\e ]] + [[ folder == \f\o\l\d\e\r ]] + db_download /Personal/2011/folder1/ringtones ./2011/folder1 ++ normalize_path /Personal/2011/folder1/ringtones +++ builtin printf %s /Personal/2011/folder1/ringtones ++ path=/Personal/2011/folder1/ringtones ++ [[ 0 == 1 ]] ++ echo /Personal/2011/folder1/ringtones + local SRC=/Personal/2011/folder1/ringtones ++ normalize_path ./2011/folder1 +++ builtin printf %s ./2011/folder1 ++ path=./2011/folder1 ++ [[ 0 == 1 ]] ++ echo ./2011/folder1 + local DST=./2011/folder1 ++ db_stat /Personal/2011/folder1/ringtones +++ normalize_path /Personal/2011/folder1/ringtones ++++ builtin printf %s /Personal/2011/folder1/ringtones +++ path=/Personal/2011/folder1/ringtones +++ [[ 0 == 1 ]] +++ echo /Personal/2011/folder1/ringtones ++ local FILE=/Personal/2011/folder1/ringtones ++ [[ /Personal/2011/folder1/ringtones == \/ ]] ++ ensure_accesstoken +++ date +%s ++ local now=1686571869 ++ [[ 1686586205 > 1686571869 ]] ++ return ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer auth' --header 'Content-Type: application/json' --data '{"path": "/Personal/2011/folder1/ringtones"}' https://api.dropboxapi.com/2/files/get_metadata ++ check_http_response ++ CODE=0 ++ case $CODE in ++ grep -q '^HTTP/[12].* 400' /tmp/du_resp_debug +++ sed -n 's/{".tag": *"*\([^"]*\)"*.*/\1/p' /tmp/du_resp_debug ++ local 'TYPE={"error_summary": "path/not_found/.", "error": path' ++ case $TYPE in ++ echo ERR + TYPE=ERR + [[ ERR == \D\I\R ]] + [[ ERR == \F\I\L\E ]] + print ' > No such file or directory: /Personal/2011/folder1/ringtones\n' + [[ 0 == 0 ]] + echo -ne ' > No such file or directory: /Personal/2011/folder1/ringtones\n' > No such file or directory: /Personal/2011/folder1/ringtones + ERROR_STATUS=1 + return + read -r line + local 'FILE=/Personal/2011/open source' + local 'META=folder;' + local TYPE=folder + local SIZE= + FILE='open source' + [[ folder == \f\i\l\e ]] + [[ folder == \f\o\l\d\e\r ]] + db_download '/Personal/2011/folder1/open source' ./2011/folder1 ++ normalize_path '/Personal/2011/folder1/open source' +++ builtin printf %s '/Personal/2011/folder1/open source' ++ path='/Personal/2011/folder1/open source' ++ [[ 0 == 1 ]] ++ echo '/Personal/2011/folder1/open source' + local 'SRC=/Personal/2011/folder1/open source' ++ normalize_path ./2011/folder1 +++ builtin printf %s ./2011/folder1 ++ path=./2011/folder1 ++ [[ 0 == 1 ]] ++ echo ./2011/folder1 + local DST=./2011/folder1 ++ db_stat '/Personal/2011/folder1/open source' +++ normalize_path '/Personal/2011/folder1/open source' ++++ builtin printf %s '/Personal/2011/folder1/open source' +++ path='/Personal/2011/folder1/open source' +++ [[ 0 == 1 ]] +++ echo '/Personal/2011/folder1/open source' ++ local 'FILE=/Personal/2011/folder1/open source' ++ [[ /Personal/2011/folder1/open source == \/ ]] ++ ensure_accesstoken +++ date +%s ++ local now=1686571870 ++ [[ 1686586205 > 1686571870 ]] ++ return ++ curl -X POST -L -s --show-error --globoff -i -o /tmp/du_resp_debug --header 'Authorization: Bearer auth' --header 'Content-Type: application/json' --data '{"path": "/Personal/2011/folder1/open source"}' https://api.dropboxapi.com/2/files/get_metadata
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I can consistently reproduce recursing into directories that don't exist from the root.
I tried to debug it, but wasn't able to fix. Reading from stdin recursively looks suspicious. Could behave differently on a mac?
full debug output
The text was updated successfully, but these errors were encountered: