andreafabrizi / Dropbox-Uploader

Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service.
https://www.andreafabrizi.it/2016/01/01/Dropbox-Uploader/
GNU General Public License v3.0
6.56k stars 1.08k forks source link

Upload is trying to save some files as their parent directory #589

Open billyJoePiano opened 8 months ago

billyJoePiano commented 8 months ago

I am having an issue where I'm trying to upload a large directory using this script. Sometimes the files have a local path which looks something like this:

/mnt/usb/MainDir/subdir/myFile1.jpg /mnt/usb/MainDir/subdir/myFile2.jpg etc...

but the script attempts to upload all of the files as:

/MainDir/subdir

When it should be /MainDir/subdir/File1.jpg /MainDir/subdir/File2.jpg etc...

When this happens, the first file gets uploaded as the name of the directory, and the subsequent files all fail to upload.

The issue is sporadic, and the subdirectories which cause problems seem to change every time I run it. It seems to happen both in the top-level directory (like this example), and in nested subdirectories of subdirectories.

Note that I am using the -s switch, to skip files that have already been uploaded. I don't know if that is related to the problem. Also, I am running this on FreeBSD 13.2 (as installed by pkg install dropbox-uploader) and had to make a small modification to the script to force curl to use http1.1 -- it was defaulting to http 2 which was causing other issues with the script. Specifically, the change was on line 142, setting variable CURL_BIN="curl --http1.1". Again, I don't know if this is related to the issue, but it seems like it is something else with how the script is recursing through subdirectories and files.