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. I initially written this script to schedule automatic server backups to a DropBox folder :)

Why use this script?

Portable: It's written in BASH scripting language and only needs cURL (curl is a tool to transfer data from or to a server, available for all operating systems and installed by default in many linux distributions).
Secure:It's not required to provide your username/password to this script, because it uses the official Dropbox API for authentication process.

More info and source code on github: https://github.com/andreafabrizi/Dropbox-Uploader

If you want to support this project, please consider donating:
  1. PayPal: andrea.fabrizi [at] gmail.com
  2. BTC: 1JHCGAMpKqUwBjcT3Kno9Wd5z16K6WKPqG

#0 - Philip [2010-10-22 20:01:19 CET]

Excellent script ! Exactly what I needed. Thanks !
#1 - Monica B [2010-11-05 22:23:46 CET]

#2 - Shane [2010-11-19 18:53:57 CET]

Just what I was looking for!!! Thank you.
#3 - maravento [2010-11-23 22:53:44 CET]

Muchas Gracias. Thanks a lot friend. You save me

#4 - vovs [2010-11-25 09:26:13 CET]

Great job!
#5 - Mikkel Kristiansen [2010-11-28 12:32:18 CET]

Finally I'm somewhat able to use Dropbox on my arm-server! Thanks a lot!
#6 - magne [2010-12-30 11:27:38 CET]

This is great! I just wish there was a way of doing this without relying on regex(what if they suddenly changes the site), and without storing my dropbox password in clear text.
#7 - Miles [2011-01-11 03:24:18 CET]

This is perfect, except it stumbles on folders with spaces, even when enclosed with quotations.
#8 - bram [2011-01-18 16:59:09 CET]

Great script! Do you think it is also possible to make a download or sync script in BASH? I want do download file or sync files from dropbox to a server without using FTP.
#9 - seventh [2011-01-22 20:49:18 CET]

Give us RSS or e-mail alert when new versions published
#10 - Michael Hart [2011-02-06 09:28:51 CET]

For anyone getting "Failed" when uploading, maybe this will save you some time :)

Max file size: 300MB.
#11 - bng44270 [2011-02-23 22:48:33 CET]

Using this in conjunction with tar to backup my /etc and /var/www folders to dropbox. LOVE IT!!!!
#12 - Alex [2011-03-09 18:22:40 CET]

Good work, man! Nice script.

But can you modify this script to receive public url of uploaded files? It would be perfect!
#13 - andi [2011-03-19 23:41:44 CET]

happily using it, thanks for sharing!!
#14 - Mike Redd [2011-03-20 20:37:42 CET]

Letting you know I've made an Arch Linux pkgbuild for script.
Hope you do not mind, I really enjoy using it.
#15 - _b1 [2011-04-02 12:11:46 CET]

please, put it to github!
#16 - gward [2011-04-12 18:50:52 CET]

Great script. Upload works great. Now I need to be able to delete files in my Dropbox from the script. I run a automated script to upload the latest file by date and delete the old files I am backing up.
#17 - timendum [2011-05-26 10:03:41 CET]

#18 - none [2011-06-19 16:16:15 CET]

Thank you for the great script! Please add an option to limit upload speed, used in shared bandwidth network.
#19 - Davide [2011-07-14 12:27:48 CET]

#20 - Lemur [2011-08-06 08:11:36 CET]

Very nice script, thank you for your good work!

Are you know also the "curl -line" to remove files and rekursive folders on dropbox-side, after the script logged in?

I would need this to remove my old backups...

#21 - José Lopes [2011-09-28 16:27:13 CET]

I created a Shell Script which uses your excelent BASH Dropbox Uploader to sync my webserver's backup with Dropbox. I call it Weback -- https://bitbucket.org/joselopes/weback

Unfortunatelly, according to [1], Dropbox refuses files with more than 300 MB. To upload such files, we need to use their default uploader.

[1] http://www.dropbox.com/developers/docs
#22 - Carlos Rendon [2011-11-17 22:09:12 CET]

What an excellent and useful piece of code. Thank you very much!!!
#23 - Uddhava [2011-12-11 17:20:22 CET]

Love this script!.
I do get some curl (timeout?) errors when i upload a 150-250MB file.
For example:
curl: (52) Empty reply from server
+ grep 'HTTP/1.1 302 FOUND' /tmp/du_resp_debug

This does not happen with a 100mb file.
Any ideas ?
#24 - Niklas Rother [2011-12-22 18:26:21 CET]

Hey, I really like your script, I'd like to use it to save some Backups. But these are too big: 500MB each file.
I tried to add an option to split files, that are to big and upload them in parts, but I failed ;)
It would be great, if you could help me!
#25 - Eugene [2012-03-01 05:45:57 CET]

Thanks a lot! Works good. One minor issue: Does not work under cygwin as is because home dir path can contain spaces. So config file has to be stored somewhere else for cygwin.
#26 - Carrot Cruncher [2012-04-03 16:51:36 CET]

great script. not sure if this is a limitation of the api but, could this script be enhanced to recursively upload and download directories/folders ? cheers.
#27 - Carlos Herrera [2012-04-18 18:43:55 CET]

Excellent, thats a good script! keep it up!
#28 - suda [2012-05-01 05:27:46 CET]

Thank you very much, Im agree with #26, it will be better if restore or sync the folders.
#29 - Shouvik Mukherjee [2012-05-18 20:19:06 CET]

Thank you very much! Such an awesome script!
I actually made a bit of modification to automate the task via crontab. Now for some reason this script doesn't work with my cronjob ... could you please help me out a bit?
#30 - Devich [2012-05-26 09:56:34 CET]

Excellent! Thank you very much!
#31 - Forcie [2012-06-11 13:07:06 CET]

I love it!
What would be awesome for me now would be a 'list command' allowing to list the content of a folder, and being able to download a whole folder (doesn't have to be recursive at first).
Thx =D
#32 - riyelpicture [2012-06-14 09:35:35 CET]

love this script! thanks..<br/><br/>BTW what if We want to upload multiple files with this script? it would be nice if this uploader could handle multiple files as an option..<br/><br/>but as for now, I try this solution and it works: write a script that will list (ls) all of my files within certain location and We can combine it with the power of grep and output the results to some temp file. We could then read the lines and execute the dropbox uploader script for every lines (filenames)..
#33 - Ben King [2012-06-28 19:15:11 CET]

It would be nice to see some errors results built into the script for files that are over the maximum 150GB API limit. I had a heck of a time debugging the script operation until I found this out.
#34 - Dylan Hall [2012-07-04 07:42:06 CET]

This would completely solve my problem if it could just download the contents of a folder.. love your work however, this is the closest I've come so far!
#35 - Jean [2012-07-04 22:51:08 CET]

Hi guys,

Thx a lot for this script : I'll use it to upload video taken by my home made security system to my DropBox.
Does anyone know if some DropBox FUSE project is mature enough to be used to upload videos directly on DropBox using a DropBox file system ?

Many thanks for any kind of reply on this subject :-)
#36 - daraeman [2012-07-31 08:12:14 CET]

Thanks for the script! Just stumbled upon this and I\'ll definitely be using it in the future.
#37 - Alex [2012-08-10 11:54:04 CET]

Thanks :)
#38 - Andrea Cortopassi [2012-08-10 21:40:23 CET]

Grazie mille per lo script, funziona davvero bene. Per il limite dei 150 mb ho risolto facilmente zippando i files con lo split in automatico, per fare quello che mi serve va + che bene.
#39 - JohnO [2012-08-17 22:05:50 CET]

Magnificently simple and effective. There is an list command that isn\'t yet full described. The list command has some problems with it. Well done Andrea my ARM devices can join the cloud.
#40 - Paulo Raponi [2012-09-06 20:20:19 CET]


Great script. I don't know if it's possible, but can the script send a mail when some error happen? We are with an issue that when the dropbox account is full, the upload stop to send. I can receive a mail if this happen?
#41 - Timido [2012-09-11 13:12:35 CET]

@Paolo Raponi
I would suggest to not mix functions inside this script.
For sending emails, I would make a "master" script which in turn calls this script to upload to dropbox and then calls email command (eg: sendmail, or whichever script) to send the email in case of error (on the basis of exit code of this script).
#42 - Andrea [2012-09-11 13:35:17 CET]

I agree with Timido :)
#43 - Andy [2012-09-17 15:56:30 CET]

yes, Great script. I used it several months, but it can not upload folder now, can ipload one file only. can you tell me how to upload folder?
#44 - Andrea [2012-09-17 17:55:20 CET]

I'm not sure i add this functionality to Dropbox Uploader, but in the meantime you can use this simple script:

for i in $(find myLocalDir/ -type f); do ./dropbox_uploader.sh upload $i $i; done;
#45 - Andy [2012-09-18 16:41:16 CET]

Yes, it work well, thank you very much. I would suggest to add this function on next version.
#46 - B [2012-09-18 20:25:00 CET]

Why not use this?


#47 - Andrea [2012-09-20 17:45:58 CET]


Is in the roadmap.
#48 - heylinux.com [2012-09-20 19:00:36 CET]

Thank you very much!!!!
This script is awesome! I'm using it to backup my VPS.
It's very kind of you to keep updating this script.
#49 - Chris [2012-09-27 02:38:59 CET]

Thanx. This was very helpful!

If I want to be able to run the script from anywere without being in the Dropbox-Upload directory. How do I do that?? Add: export PATH=$PATH:/new/path where?

Kind Regards
#50 - Steve [2012-10-05 11:56:03 CET]

Andrea, thanks for this script: it was just what I needed. I wanted to let you know of a change I made to my local copy, and to ask a question.<br/><br/>First, the change: when I registered the app with dropbox I chose to give it access to just a single folder (because I\'d installed this script on a server I don\'t fully trust). To make this work, I modified these three URLs to replace \"dropbox\" with \"sandbox\":<br/><br/>API_CHUNKED_UPLOAD_COMMIT_URL=\"https://api-content.dropbox.com/1/commit_chunked_upload/sandbox\"<br/>API_DOWNLOAD_URL=\"https://api-content.dropbox.com/1/files/sandbox\"<br/>API_METADATA_URL=\"https://api.dropbox.com/1/metadata/sandbox\"<br/><br/>That might be something you could include as an option; if not, it might be helpful for others.<br/><br/>Second, the query: I tried running the script as a cron job but it had no effect. I\'m going to enable DEBUG to see if I can figure out what\'s happening; my wild guess was that maybe the config file wasn\'t found when run by cron, but I don\'t really know.<br/><br/>Anyway, thanks for the script. :-)<br/><br/>Cheers,<br/>Steve<br/>
#51 - Andrea [2012-10-05 12:00:39 CET]


Thanks for your suggestion.

Try to change the default config file path with the absolute path (/home/user/.dropbox_uploader).

#52 - Steve [2012-10-07 10:14:09 CET]

Follow-up to my cron problem: this was my fault! The script was fine. My cron line involve percent-signs, which crontab translates to line breaks; I escaped them and all is well. False alarm. :-)

Thanks again,

PS Apologies for the formatting of my previous comment. I had to re-enter the security code and the text in the comment box had been replaced with HTML.
#53 - John [2012-10-08 05:52:53 CET]

Great job, thanks for this!

Could you also please implement the move command?
#54 - Marco [2012-10-10 11:59:44 CET]

Great script! use it all the time!

Now I want to use it on OpenWrt. Had to replace stat by &quot;wc -c&quot; but still run into &quot;An error occurred requesting /commit_chunked_upload&quot;.
U have any idea why this is?
#55 - asd [2012-10-11 10:42:20 CET]

Thanks, nice script. Keep life simple ;)
#56 - PengYu [2012-10-11 16:44:09 CET]

For non-English files, we should encode/decode the file name to UFT-8 first, use convmv or other command.

convmv -f gb2312 -t utf-8 --notest 测试.zip
#57 - Ronnie [2012-10-11 23:33:35 CET]

@Marco I had the same problem. The cause is the incompatibility of the &quot;sed&quot; version of busybox. The solution was simple:
- install sed (opkg update; opkg install sed)
- edit the script, replace &quot;sed&quot; with &quot;/usr/bin/sed&quot;
#58 - Alex [2012-10-18 02:24:36 CET]

Chunk upload not working in freebsd 8.3. please fix it :(
#59 - cufre [2012-10-19 11:49:24 CET]

Sto testando lo script con Zeroshell, ho dovuto aggiungere il parametro -k al comando curl per completar e il setup. il dowload funziona mentre in upload stesso problema di Alex &quot;An error occurred requesting /commit_chunked_upload&quot;
Se qualcuno avesse suggerimenti.. grazie ad Andrea per lo script
#60 - cufre [2012-10-19 18:40:08 CET]

usando la versione precedente dello script (senza i chunk files) funziona anche l'upload..Olè
#61 - Andreas [2012-10-23 19:34:31 CET]

Unfortunately, I still do not understand the function. I tried on Windows 7:
curl dropbox_uploader.sh info
But that does not work:
curl: (6) Could not resolve host: C; Host not found
Could you please help?
#62 - Florian [2012-10-24 06:45:57 CET]

Great script! Thank you!
#63 - monete [2012-11-01 12:21:39 CET]

Works like a charm!

Thank you for developing this useful tool. You are a hope for the Raspberry Pi users looking for a Dropbox oficial release substitute.

Complimenti and keep it up! ;)
#64 - Alex [2012-11-05 18:24:43 CET]

Thank you very much! Very usefull script. Work good on FreeBSD 8.3 but can't work as cron job :(
#65 - Elko [2012-11-05 20:39:38 CET]

Hey Andrea,

thank you very much for your awesome work. Uploading my stuff right now from my Raspberry Pi.

Can you tell me how to use the recursive upload function which was implemented since v0.5? I used your workaround (for i etc.) but I assume this might be just a temporarily solution.

Thanks in advance.

Regards Elko
#66 - Pau [2012-11-25 14:33:41 CET]


I downloaded the script yesterday and wanted to use it to download all the contents of my dropbox to my linux-based NAS.

Since I couldn't find the option, I modified the script to be able to recursively download folders.

Here it is.


thank you.
#67 - dddesign [2012-12-03 23:57:47 CET]

great script, I use it on my openwrt-box.
1. I'm not shure if I can replace &quot;stat&quot; with &quot;wc -c&quot;, but anyway, I need the script for downloading
2. I use Pau's (comment #66) script with the &quot;sync&quot; command, great.
but now two questions:
A. how can I adapt the script that I can give a destination folder for &quot;sync&quot; (=download) all folders and files? I need this because I want to add it as a cron job. or is there another possiblity?
B. how can I adapt the script that it's &quot;sync&quot; (=download) only files and folders not existing in my destination folder?
@pau: any chance that you adapt your script with my requirements?
thanks a lot in advance
#68 - Tim [2012-12-07 17:23:02 CET]

Excellent Scrip!... but I think I may have found a bug...?

Create a file simply called &quot; H&quot; on the dropbox. (That's a space, followed by a capital H)

Then execute the following:

/bin/bash /home/pi/gframe/dropbox_uploader.sh download &quot; H&quot;
This returns with a &quot;FAILED&quot; error.

It appears to only be an issue with a CAPITAL letter H preceded by a space.

Other than that though, it appears to work really well and is a godsend on platforms like the Raspberry pi which don't support the official dropbox client.

Feel free to contact me if you have any questions.
#69 - Gordon Schulz [2012-12-12 09:24:39 CET]

Awesome script, thanks a lot for your great work.
#70 - Geert [2012-12-30 18:53:16 CET]

Works great. Using it on Centos 6.3 and on a hacked Pandigital 6&quot; eReader.
#71 - Marceau [2012-12-31 16:58:03 CET]

Pretty nice.

Thanks for making this and putting it up.
#72 - Diego [2013-01-10 01:29:57 CET]

Hello, I want to use your script, but when trying to download it I receive:
There aren't any uploads for this repository.

Please upload it, thanks a lot!

by the way, can I use it with a cronjob configured on my hosting?
#73 - Andrea [2013-01-10 11:07:19 CET]

@Diego: i have fixed the link, thanks.
Yes, you can schedule the script using crontab.
#74 - Mark [2013-01-20 04:57:17 CET]

[email protected]:~# ./dropbox_uploader.sh
: No such file or directory

how is that possible? The file exists and is executable!
#75 - Matthew Manning [2013-01-30 13:04:31 CET]

This is great. But it's not really dropbox. It doesn't allow you to automatically cron and therefore upload files to drop box.

It's all a little manual. It would be great to have it work more like drop box
#76 - VDIAS [2013-02-07 11:06:34 CET]

How can i upload a entire directory?

#77 - Ray K [2013-02-08 02:12:46 CET]

Super awesome!! Thanks a ton for this! Will transition this from my Ubuntu system to my Raspberry pi when I have it take over these kinds of functions!
#78 - frogfire [2013-02-14 10:10:44 CET]

Thank you soooooooooooooooooooooooooooooooooooooooo much!! You made my day
#79 - Janine [2013-02-16 13:36:29 CET]

Great script! Thans a lot. I use it for sending weekly my backup-files of the databases and home pages to my dropbox. And it is so easy to use :-)
#80 - Ashish [2013-02-21 16:59:30 CET]

Awesome script! Works like a charm. Just what I needed to upload some files to my DropBox account from my Raspberry Pi.

Thanks a lot!
#81 - Raspberry [2013-02-26 14:51:44 CET]

You are my Hero !!!!1
#82 - TrappedInSide [2013-03-07 18:47:56 CET]

Thanks for the hard work.
#83 - Dan Hvidding [2013-03-13 16:50:23 CET]

This script is awesome. Really helped me get a large file out from a place with a crappy network connection. Thanks for sharing!!
#84 - Martin [2013-03-20 09:48:50 CET]

Thank you! I've used this to upload images from my Raspberry Pi &quot;security&quot;-cam. It worked right away, and exceeded my expectations.
#85 - Hide74 [2013-03-23 12:38:34 CET]

Thank you for great script!
I tried to use it with busybox by splitting each function into a scripts and small modifications. Now, I can run this on DD-WRT without bash.
#86 - Beakid [2013-03-28 08:16:22 CET]

Hi! Thanks for an awesome script.

Is it possible to execute the script from a php-file online? I have tried executing it with:

$output = shell_exec('sh /usr/home/dropbox_uploader.sh upload test.txt');
echo $output;

But I keep getting &quot;Error: this script requires BASH shell!&quot;. I tried uncommenting that bash-check in the script, but it won't work nevertheless. I have also tried executing it as a background process but without luck.

Anyone? :)
#87 - shiedman [2013-04-16 10:13:23 CET]

great job,man!
#88 - openwrt [2013-04-28 14:29:34 CET]

will be usefull! thank you
#89 - Kayr [2013-04-30 12:33:25 CET]

#90 - Fred [2013-05-02 01:25:19 CET]

Very useful,

Thank you!
#91 - minimoto [2013-05-08 20:04:47 CET]

Thank you for your hardwork and I am able to run your script. Only thing I am having is when I try to send mysqldump file to dropbox, URLencoding force file name to change to generic urlencode name. Is there way to keep original xxx.sql file name?
#92 - Alexandre Santos [2013-05-10 00:42:39 CET]

Awesome work. I can finally fine tune my backups with DropBox :)
#93 - moose [2013-05-15 07:55:52 CET]

Thank you so much! Amazing work, really helpful. I have a quick question/request
Is there a way to download all files in a folder at once?
#94 - Hugh [2013-05-16 15:23:42 CET]

Brilliant! Just what I needed!
#95 - Javier [2013-05-21 23:33:04 CET]

Great script, I just downloaded it and started using it to backup my website.
Unfortunately my hosting company (godaddy) provides a version of &quot;curl&quot; that does not support the option --data-urlencode. Could you suggest any workaround? Thanks ;-)
#96 - blogmywiki [2013-05-25 11:21:21 CET]

Fantastic script, thank you so much Andrea. I have it running on my RaspberryPi - found it very easy to set up. I'd also like to know if there's a way of downloading all files from a Dropbox folder without knowing their names?
#97 - Andrea [2013-05-28 15:57:16 CET]

Fixed problems with --data-urlencode.

#98 - Giancarlo [2013-06-03 15:51:58 CET]

Hi, I love your script, I have a simple request:

Can you enable wildcards so I can sync an entiere folder between my working copy and dropbox ?
#99 - jens [2013-06-10 23:35:20 CET]

Worked perfect very easy usage self explaning, good job.
#100 - Panos [2013-06-17 09:47:16 CET]

Great script! Thank you so much for creating and maintaining it!

I would like to second that request from &quot;Giancarlo&quot; above for wildcards if possible.
#101 - OlgaMaria [2013-06-28 01:34:57 CET]

This is exactly what I've been looking for. Thanks! :)
#102 - Geoff Lane [2013-07-03 15:24:04 CET]

Brilliant utility but I'd love to know how to resume an upload after a failure. So annoying when a video upload fails near the end.
#103 - Skillsy [2013-07-07 15:53:38 CET]

What a fantastic script and thank you for the time and effort developing. Works excellently under cygwin if you install CURL and was a way to get the required tokens and move the resulting config file to our production environment (that prevents direct web browser access).

#104 - Greyson [2013-07-10 03:33:38 CET]

Fantastic script, thank you!

I have on request (if it is even possible):
Can the script be modified to check if a file is different from the one on dropbox, so that it doesn't upload every file in a directory every time? Syncing takes some time for my large folders and it would be hugely time-saving if this could happen.

Thanks again!
#105 - f0ruD [2013-07-12 17:40:11 CET]

Thanks for this great script.

I create an AUR package for archlinux here : https://aur.archlinux.org/packages/dropbox-uploader-git/
#106 - Vince [2013-08-09 10:14:05 CET]

very nice, great example of how to utilise the DB api, have alread added to your excellent script

dropbox-uploader longlist / -h
&gt; Listing &quot;/&quot;... DONE
[D] Mon 05 Aug 2013 01:07 --- bin
[D] Sat 27 Jul 2013 23:30 --- Documents
[D] Thu 01 Aug 2013 08:48 --- emu_working
[D] Tue 30 Jul 2013 06:37 --- emulator
[D] Sat 27 Jul 2013 23:24 --- Pictures
[D] Tue 30 Jul 2013 06:37 --- src
[D] Mon 05 Aug 2013 01:07 --- uqlx-py
[D] Tue 30 Jul 2013 06:37 --- Videos
[F] Thu 03 Jan 2013 13:38 243.3 KB Getting Started.pdf
#107 - CA [2013-08-10 10:35:25 CET]

Great script, is there a way to make it ignore files that already exist on the target and just upload/download the deltas?

#108 - marttt [2013-08-11 17:08:40 CET]

Thank you very much for this. Precisely what I needed.
#109 - Chris [2013-08-12 17:08:21 CET]

Is there any way to preserve the server timestamp of the downloaded files?

#110 - ryzhov_al [2013-08-29 08:45:46 CET]

Dropbox Uploader included into Entware repo for MIPSEL routers. Works well. Thank you!
#111 - MegaV0lt [2013-09-08 12:00:39 CET]

Thank you for the script! It made my day!
#112 - Masamiti [2013-09-16 07:57:02 CET]

Thank you for the script, but I found a dug in the script when I tried to download nested directories.
The bug happen because variable $DEST_DIR is overwritten incorrectly.
So line 602 in code (function db_download)

DEST_DIR=$(normalize_path &quot;$DST/$basedir&quot;)
local DEST_DIR=$(normalize_path &quot;$DST/$basedir&quot;)

#113 - Andrea [2013-09-16 09:54:03 CET]

Thanks Masamiti,
bug fixed.
#114 - Giuseppe [2013-09-26 11:49:24 CET]

Ottimo, utilizzato su Raspberry senza nessun problema.


#115 - Arie0510 [2013-10-16 16:21:36 CET]

Thanks for your script. When i tried to run it on my sparc linux machine, I received the following error:

./dropbox_uploader.sh: line 279: conditional binary operator expected
./dropbox_uploader.sh: line 279: syntax error near `=~'
./dropbox_uploader.sh: line 279: ` if [[ $ERROR_MSG =~ .*access.attempt.failed.because.this.app.is.not.configured.to.have.* ]]; then'

This is due to the fact that I use bash 2.05b, i.e. an old bash before bash 3. Therefore the =~ operator can not be used. I believe the following code achieves the same

case $ERROR_MSG in .*access.attempt.failed.because.this.app.is.not.configured.to.have.* )
echo -e &quot;\nError: The Permission type/Access level configured doesn't match the DropBox App settings!\nPlease ru
exit 1

but does not use the =~ operator and therefore makes the script work in older bash-versions too.

#116 - Andrea [2013-10-17 09:06:33 CET]

Thanks Arie0510,
I've fixed the problem with the last commit.
#117 - Arie0510 [2013-10-17 13:23:11 CET]

Hi Andrea,
I am trying to get your script running on my Readynas NV+ (sparc). That NAS has this old bash-version I mentioned in my previous post. But also some other issues:
1) For printf the option -v is not recognized
2) The syntax += is not recognized
3) The shell option nocasematch is not recognized.

I fixed these issues in the following way:

MODIFICATION 1: I changed line 302 from
* ) printf -v o '%%%02x' &quot;'$c&quot;
* ) o=`printf '%%%02x' &quot;'$c&quot;`

MODIFICATION 2: I changed line 304 from

MODIFICATION 3A: I changed line 409 from
basefile_dst=$(basename &quot;$FILE_DST&quot;)
basefile_dst=$(basename &quot;$FILE_DST&quot; | tr '[:upper:]' '[:lower:]')

MODIFICATION 3B: I removed lines 406 and 421, i.e. the lines
shopt -s nocasematch
shopt -u nocasematch

Note that MODIFICATION 3A introduces additional dependency on tr, causing a change in line 60 where BIN_DEPS is defined. Alternatively you can use sed instead of tr for MODIFICATION 3A.

Using the above changes (including the one in the earlier post) I have so far been able to complete the setup on my Readynas, and alos I managed to upload files to my Dropbox account.

I'll now continue testing your script for the other options (other than 'download'), and let you know the outcome.
#118 - Greg [2013-10-21 14:47:25 CET]

Is there anyway that a option can be added to auto delete files on drop box that are older than x days. I think this would be really useful.
#119 - Alejandro [2013-11-08 15:51:11 CET]


This is a god tool. I have recently used it with openwrt to upload videos from my web cams to dropbox.

Although i am experimenting some problems with list parameter.

I have a remote directory but it seems that I can't list directories with more than 31 elements (files or sub-directories). The error showed is:

Listing &quot;/DIRGAN_HOME_SERVER/VIDEOS&quot;... FAILED: /DIRGAN_HOME_SERVER/VIDEOS is not a directory!

Any suggestion?

#120 - sunsina [2013-11-18 15:35:55 CET]

I could not manage to make the script work on LININO flavor of
OpenWrt which comes with Arduino Yun.
I just copied the dropbox_uplader.sh into /usr/bin and execute '#dropbox_uploader.sh' as root and I got following error:

Does any body knows how can I fix the problem?
Error: Required program could not be found: stat
#121 - sunsina [2013-11-18 16:02:14 CET]

Ok,I figure out what was missed
the package name is coreutils-stat I just installed it to give it a try
#122 - sunsina [2013-11-18 23:55:21 CET]

Another problem with OpenWrt(LININO Arduino Yun).
I get following error:
Error: cURL is not able to performs peer SSL certificate verification.
Please, install the default ca-certificates bundle.
To do this in a Debian/Ubuntu based system, try:
sudo apt-get install ca-certificates

It seems there is no equivalent in opkg such as &quot;opkg install ca-certificates&quot;
I do not know how can I attack the problem and how to obtain and where to store the DropBox certificate.
Any help will be appreciated

It seems that I have to install
#123 - Andrea [2013-11-20 17:01:24 CET]

I think that you have to install the CA bundle manually.
Otherwise you can try the Dropbox Uploader -k option, it's insecure but it should works...
#124 - Salomon [2013-11-21 13:31:29 CET]

Perfect, it worked for my 'digital picture frame' with the first go.
Thanks a lot
#125 - Paul Dev [2013-11-28 22:36:29 CET]

Excellent - perfect solution!
#126 - BYQ [2013-12-09 10:24:23 CET]

Hi, excellent script. Is there a way to have multiple instances of this script on single machine? (like different names of script file for different dropbox accounts, of course with different config files). I tried to do it, but ended with:
$ ./db01.sh list
&gt; Listing &quot;/&quot;...
Error: The Permission type/Access level configured doesn't match the DropBox App settings!
Please run &quot;./db01.sh unlink&quot; and try again.
What's weird - the same script executed with 'info' parameter seems to display correct data about dropbox account (name, email, quota, etc)
#127 - Andrea [2013-12-09 17:36:34 CET]

Hello BYQ,
you can use the -f option to specify different configuration file.

If you get that error message, it means that the script is not configured correctly.
#128 - Alessandro [2013-12-18 10:39:43 CET]

Thank you very much for the script!
A question: when use the download option there is a way to overwrite existing local files only when the content is different? Now there is only the -s option, but the check is only for the file name.
Thank you
#129 - JPhil [2014-02-18 10:48:45 CET]

This is an excellent script :-)
It's just I'am looking for and exactly what I needed.
I have just one question :
- How to create 2 API keys for upload to Dropbox @ gmail and Dropbox @ another. I would like to send some file into one or another account with my script.

Thanks Great job!

Best Regards
#130 - Andrea [2014-02-18 15:08:19 CET]

You can use the -f option, to specify a different configuration file.
#131 - JPhil [2014-02-19 21:48:05 CET]


* Thanks, in fact it was the same query than #126 and #127. Sorry .
But I don't understand where is my configuration file ?
It's the Provide app name wich give me the app name folder ?

Best Regards.
#132 - Andrea [2014-02-20 09:00:59 CET]

You can use the configuration file name you want, eg:
./dropbox_uploader.sh -f ~/.conf1
./dropbox_uploader.sh -f ~/.conf2
./dropbox_uploader.sh -f ~/.conf3
#133 - Emanuele [2014-02-21 14:14:30 CET]

Very nice !

I noticed that after downloading timestamps are not preserved, is there a way to set this option ?

Thank you.
#134 - JPhil [2014-02-23 17:02:05 CET]


Thanks for your help.

Best Regards
#135 - Guillermo [2014-02-25 19:57:40 CET]

Hey, excellent job, thanks for sharing.
#136 - Andrew [2014-03-05 03:21:47 CET]

You, hacker! great job. Thank you
#137 - TA [2014-04-02 20:33:31 CET]

Great work man!
I finally got it working. I had a &quot;SYNTAX&quot; issue on line 764. Quotes missing.
#138 - TJ [2014-04-03 17:37:26 CET]

Excellent job!
Now, I cannot get pass the server proxy.
set HTTP_PROXY_USER=blahbblha
set https_proxy=blew

Error: Couldn't connect to host.

help please.
#139 - TJ [2014-04-03 18:46:21 CET]

Excellent job!
Now, I cannot get pass the server proxy.
set HTTP_PROXY_USER=blahbblha
set https_proxy=blew

Error: Couldn't connect to host.

help please.
#140 - Johnson [2014-04-07 21:31:04 CET]

Can this be used in a x64 bit machine?
I am having the following problems,
'shopt' command not found,
' [[ ' command not found

Please I need help with this. Thx
#141 - HugoC [2014-04-09 15:53:29 CET]

Been looking for a drobpox official client substitute for a LONG time. Mainly for backups of my home servers and various stuff, too.

This script works great on Debian Wheezy, both on x86 and various ARM-based sticks.

Thanks for your efforts!
#142 - GRoston [2014-04-21 06:24:21 CET]


Thanks for making this super useful script available.

I just installed it on my shared host (Red Hat 4.4.7-3, based on kernel 2.6.32-379.22.1.lve1.2.14.el6.x86_64). The script installed without any problems, but it does not behave properly. Specifically, when I enter the command:

./dropbox_uploader.sh upload &lt;filename&gt;

the script prints its usage and does not upload the file. When I enter the command:

./dropbox_uploader.sh upload &lt;filename&gt; &lt;filename&gt;

the script does copy the file to dropbox. The problem is that I can to create a cron job to upload a file whose name will change very day, thus the latter form does not help.

Could you please suggest how I can fix this problem.

#143 - Andrea [2014-04-23 13:46:38 CET]

GRoston, you have to specify the destination file/directory. So:
./dropbox_uploader.sh upload filename /

Please take a look to the README file.
#144 - Enrico [2014-04-29 09:23:15 CET]

Dear Andrea,
Complimenti per l'ottimo lavoro!
I've been using it for a while without any problems as a cronjob on a QNAP NAS.
After restarting the NAS I had to re-authorize the app on my Dropbox, but this was not a big problem.
The real problem I've encountered, tried to debug myself but cannot get past, is this:

&quot;Error: Required program could not be found: printf&quot;

I get it into the cronjob log every time it tries to launch dropbox_uploader.sh ...
The strange thing is that if I try to run it manually, it works like a charm! (both as a user both as a super-user).

What could it be?


#145 - Andrea [2014-04-29 10:54:35 CET]

Ciao Enrico,
can you open an issue on github please?
#146 - Dmitry Savvateev [2014-05-28 17:05:15 CET]

I've installed this script, and trying to upload (recursively) a directory of files, some of which have non-ascii (UTF-8) file names. These names appear in the web-based dropbox client as a string of character codes (instead of proper characters). Is there any way to fix this? Thank you in advance.
#147 - kapsh [2014-07-16 04:16:43 CET]

This is fucking brilliant! Thank you for the great solution for db.
#148 - Dean Bayley [2014-07-24 15:21:08 CET]

Love the script, implemented into my daily backup script replacing FTP, worked fine when i was manually launching the backup.sh it ran perfectly but when cron ran the script it kept saying no such file or directory.

I thought it wasn't passing the arugments propperly but it turned out it was the shell saying it could't find the script.

Turns out all i needed to change was the way i called the script:

### FROM ###

./dropbox_uploader.sh upload &quot;/home/complete_backup_$NOW.tar.gz&quot; &quot;/$YEAR/$MONTH/$DAY/complete_backup_$NOW.tar.gz&quot;

### TO ###

source /home/scripts/dropbox_uploader.sh upload &quot;/home/complete_backup_$NOW.tar.gz&quot; &quot;/$YEAR/$MONTH/$DAY/complete_backup_$NOW.tar.gz&quot;
#149 - soifran [2014-08-10 15:42:43 CET]

Hi Andrea !

Great job you've done.
I installed the sofware on a debian server

trying to download some files from my dropbox, a &quot;permission denied&quot; occurs on every step, when the script tries to write a file or folder on my server.

Could you help me to check what step I've missed ? Should I run the script as root ?
#150 - Luiz Fernando [2014-08-21 15:49:49 CET]

Hello there.

Great script, great job, excellent tool!

#151 - Buzzcutts [2014-08-28 18:32:30 CET]

very helpful script!
#152 - Cristiano Quintela [2014-09-23 20:03:15 CET]

Hi, awesome script!

There is a way to make the script skip file if content is the same? Like diff bin test from Dropbox App.

The -s only skip by filename.

Keep the great work!

P.S.:Sorry, my english sucks
#153 - vinzvanilla [2014-10-05 11:08:42 CET]

Thanks for sharing this very useful script ! I am using it intensively and it just works fine.
#154 - felix021 [2014-10-08 16:31:12 CET]

Excellent project! thanks so much~
#155 - frtorres [2014-10-09 21:37:20 CET]

Thanks for the script. I installed everythng on a Western Digital MyBook World Edition (white bar).

Worked ok. Thanks again and please keep the good work.

Greetings from Panama Canal,
#156 - jackson [2014-10-12 17:23:29 CET]

First thanks for your script.
Now,There is a problem the filename will be changed to mess code when I upload a file named by chinese.

#157 - Sunjay Dhama [2014-10-23 04:49:59 CET]

Thank you very much for creating this script! It has been a life-saver multiple times!
#158 - pwenzel [2014-11-05 18:03:18 CET]

I was able to get Dropbox Uploader working on my ReadyNAS NV+ (Sparc), using the following steps:

* Tested in default version of Bash (2.05b.0(1)-release), found it did not work well
* Downloaded Bash 3.2 source
* Run `./configure --build=sparc-linux`.
* Run `make` and copied the compiled bash binary to /usr/local/bin/bash
* Re-ran dropbox_uploader.sh with success!
#159 - Inco [2014-11-05 19:51:19 CET]

Hello Andrea
I use this code to split $DIR_CONTENT in lines,((from www.humbug.in/2010/bash-tricks-split-cut-a-string-with-multi-character-delimiters/ ) I don't know if it would be PORTABLE
#I don't like this piece of code... but seems to be the only way to do this with SED, writing a portable code...

D=&quot;} {&quot; #Multi Character Delimiter
string=$(echo $DIR_CONTENT)

echo $string | cut -d &quot;]&quot; -f 1 &gt; $TEMPORAL_FILE
string=$(cat $TEMPORAL_FILE)
echo $string |sed &quot;s/\&quot;//g&quot; |sed &quot;s/\,//g&quot; | sed -e 's/'&quot;$D&quot;'/\n/g' &gt; $SPLITED_FILE

while read linea
echo $linea | cut -d &quot; &quot; -f 6,19,8
done &lt; $SPLITED_FILE

I use it in your script to obtain the file size.

Thanks for your work.
Best regards.
#160 - Anto Jose [2014-11-06 20:06:54 CET]

Thank You!!!
#161 - steve [2014-11-19 07:18:39 CET]

Thanks for the great script!! I will donate.
I experimented and seems to work. Next step is to use a cron to automate the backup.
Just an important confirmation from you:

*IF* my server gets compromised a hacker could potentially delete all the backups even if he has no password for my Dropbox directly.

One workaround i was thinking was the following:
name each backup something like &lt;date_time&gt;_$$ this will give it a process ID that cannot be known.
IF i understand correctly from the API, the delete command does not take wildcards.

What do you think?

(of course there is always the possibility to &quot;brute force&quot; it through a loop)

Thanks in advance!!
#162 - Stephen Aiena [2014-12-01 20:11:25 CET]

Love the script and its wizardly setup process.

One feature request:

Recursive Listing option

My primary need (which your script serves) is to upload and manage a dropbox that contains cloud-only files, i.e., the files do not reside on a local filesystem--just on the dropbox system. I therefore have no way to do tree listings on a local filesystem.
#163 - Daniel Bryan [2015-03-05 00:15:35 CET]

Hi Andrea!

Excellent script, congratulations!

Is there any way to preserve the client timestamp with upload command?

Thanks! :)
#164 - Noel [2015-03-08 20:04:21 CET]

I'm running the script on RedHat Linux and it is awesome, but I can't get the skip option to work. I'm using this format:
[~]# ./dropbox_uploader.sh upload -s [source_dir/files] [target_dir]

The files upload fine, but it doesn't skip the existing files. Is the command formatted improperly? I'm using the script to upload backup files and I only need to upload the latest backup.
#165 - Sean O'Leary [2015-03-23 16:55:21 CET]

This utility is amazing and just what I was looking for.

Thank you!
#166 - Allan [2015-04-14 14:37:53 CET]

Works well, with one exception. I use a cctv monitor called motion, which has a callback: on_picture_save, which can be used to trigger any other program, to process the saved image. The problem is

on_picture_save /home/motion/bin/on_save_event.sh %f

where /home/motion/bin/on_save_event.sh calls dropbox_uploader.sh to uplaod the saved image to my dropbox, dropbox_uploader.sh fails to find the config file, because the script is executed as &quot;nobody&quot;, and it can't find the config file.

Is there a way to specify where the config file is?
#167 - Andrea [2015-04-14 15:23:56 CET]

Allan, use the -f option to set the absolute config file path.
#168 - Allan [2015-04-14 16:20:12 CET]

Awesome, thank you
#169 - Hao [2015-04-20 04:20:50 CET]

Awesome. I don't believe that this software still works for a long time without update. Love it so much.
#170 - Verticalx [2015-05-04 23:49:26 CET]

Fantastic script! Thanks for your work!

Is hat possible to wipe old copies of backups from dropbox using this script and &quot;mtime&quot; flag?

Will be really usiful!
#171 - Frans [2015-05-12 21:44:42 CET]

Hello, i have a problem installing dropbox on my app, hosted on openshift. Just before &quot;Setup Completed&quot;, i get this error :
&quot;Access Token request... OK
./dropbox_uploader.sh: line 1146: /var/lib/openshift/xxxxxx//.dropbox_uploader: Permission Denied&quot;
and same thing for lines 1147,1148,1149,1150.
I'm new with linux; could somebody help me with this ?
#172 - Frans [2015-05-13 16:09:07 CET]

i found the solution, if someone has the same problem :
i had to modify the CONFIG_FILE path (line 23), because openshift doesn't allow to write everywhere.
#173 - pltuan [2015-05-19 10:12:11 CET]

Thanks for this utility
#174 - Fernando [2015-06-08 13:01:33 CET]

Hi there,

Amazing and super efficient and handy script. I use it for my server backups.

I have a question though - if I want to have several configuration files (i.e for different dropbox applications) how can I create them?

I know that the -f arg can let me point to the configuration file, however - In dropbox I can only see the app id, app secret and oauth token, BUT not the oauth _secret token.

Any help will be kindy appreciated,

#175 - Andre [2015-06-26 01:55:58 CET]

Just letting you know, it runs successfully on Tomato routers (Shibby mod).
#176 - Kevin [2015-07-02 14:43:51 CET]

Hi,excellent tool!
I have one problem though, which I can’t fix (quite new to linux...). It related to running dropbox_uploaded.sh within an own script that is started via cronjobs...
I run the script on a Synology NAS to upload recorded web-radio streams to dropbox.
In my case on the Synology NAS, the crontab file sits is /etc/crontab and the cron-daemon is called “crond”.
The synology starts the crond automatically after reboot or after killing the process manually. Apparently, the crond sits in /usr/sbin/crond as this what it shows with the ps command.
This crond uses the /etc/crontab and executes my script at the requested time.
All commands in my script are executed, e.g. the recording of the web-radio stream, selecting certain files with “find”, copying selected files to subfolder etc...
Only the dropbox_uploader.sh is not executed from my script. I thought that it may have to do something with PATH, so I use absolute paths for all my commands and files (such as /opt/bin/streamripper and not just streamripper). For the dropbox script the line in my script is /volume1/public/dropbox_uploader.sh upload &lt;local file&gt; &lt;dropbox folder&gt;
Now comes the bit that I don’t understand:
When I manually start a second cron-deamon I have two processes called crond :

23173 root 4120 S /usr/sbin/crond &lt;--- this is the one that my system runs automatically and which is restarted after killall crond or reboot.
23938 root 410 S crond &lt;-- this is the process that I start manually (note that is not shown to be in /usr/sbin/ - I don’t know why....)

So now the crontab is effectively used twice. My script for recording the radiostream and uploading is actually executed twice at the same time. I can confirm this, because I send notification mails to myself from within my script.
And.... the manually started process crond (23938) DOES execute the dropbox_uploader line in my script!
BUT the process /usr/sbin/crond (23173) execute all lines in my script EXCEPT THE dropbox_uploader line.

Can anyone explain this?
#177 - Luca [2015-07-02 19:45:46 CET]

Thank you so much! Amazing work, really helpful. I have a quick question/request
Is there a way to download all files in a folder at once?
If I have this sorces into Dropbox:


How can I download all the files without creating the directory &quot;TantiFile&quot; in a destination path?
#178 - Kevin [2015-07-03 12:39:16 CET]

Seems that I found a solution for the problem described in comment #176:

in my own script I now call the dropbox_uploader with bash:

/opt/bin/bash /volume1/public/dropbox_uploader.sh upload &lt;my local files&gt; &lt;my dropbox folder&gt;

and in my crontab I call my script with source

0 21 * * * root source /volume1/public/scriptname

Now everthing works fine with the the cron-daemon in /usr/sbin/crond

#179 - Kevin [2015-07-03 12:42:48 CET]

Respons to #177 by Luca

I use the asterisk to upload multipe files, for example

dropbox_uploade.sh upload /volume1/files/*.* /dropboxfolder

You can also select certain file types, like *.txt or *.mp3 etc..
#180 - Luca [2015-07-04 00:18:41 CET]

Hi Kevin,
thankyou very much for your reply, but in my case the asterisk aren't accepted:

[email protected]:~$ dropbox_uploader list Public/Sorgente/
&gt; Listing &quot;/Public/Sorgente/&quot;... DONE
[F] 8795 Array (2).tmTheme
[F] 8795 Array.tmTheme
[F] 21597 HalfLife (2).tmTheme
[F] 21597 HalfLife.tmTheme
[F] 1352 rsync-i (2).log
[F] 1352 rsync-i.log

[email protected]:~/Test_Upload$ dropbox_uploader -s download Public/Sorgente/*.* /home/luca/Test_Upload/
&gt; No such file or directory: /Public/Sorgente/*.*

I have installed dropbox_uploader 0.14.
Can you help me?
#181 - Luca [2015-07-04 00:33:17 CET]

Found the problem!!
The asterisk can be used only when use the UPLOAD function, not DOWNLOAD!
Likely because the asterisk are interpreted only on linux box and not on Drobpox, otherwise our friend Andrea did not implement that function in his script.
Can something be done about this?

#182 - Nnako [2015-07-04 19:58:04 CET]

Great tool! Especially the cross-platform operability.


I use Python on a Windows machine and automatically upload files into the DROPBOX using the &quot;upload&quot; command. Now, I would like to get SHARED LINKs for the uploaded files, to be able to send them (automatically) by email. So, I use the &quot;share&quot; command.


The link is output only to the console window but not back into my python program. So I try to redirect the output using the &quot;&gt;&quot; operator together with an output filename. Unfortunately, within my python environment this leads to a Win32 error message when trying something like this:

os.system(&quot;.../dropbox_uploader.sh share DropboxFile &gt; OutFile&quot;)

The cause seems to be the &quot;&gt; OutFile&quot;, because omitting it works fine.


Would it be possible to ad another option e.g. &quot;-o &lt;filename&gt;&quot; for the script which directs the output into a local file? So I could read the file from Python and get the link from there.


#183 - Ron [2015-07-19 10:11:36 CET]

Doesn't work on PI 2, gives error command not found.
Probably some i didn't do right but just used copy/paste so to not make typo errors.
If any one can put this Pi noob into the right direction that would be much appreciated.

[email protected] ~ $ git clone https://github.com/andreafabrizi/Dropbox-Uploader/
Cloning into 'Dropbox-Uploader'...
remote: Counting objects: 661, done.
remote: Total 661 (delta 0), reused 0 (delta 0), pack-reused 661
Receiving objects: 100% (661/661), 197.37 KiB | 222 KiB/s, done.
Resolving deltas: 100% (333/333), done.
[email protected] ~ $ $chmod +x dropbox_uploader.sh
-bash: +x: command not found
#184 - Omer [2015-08-23 13:05:52 CET]

I'm only a beginner with the raspberry pi and this uploader has really helped me out with a project i can now declare as finished. Thanks so much.
#185 - Fred [2015-08-26 16:31:39 CET]

Many thanks for it ! :)
#186 - Alvaro [2015-10-07 21:09:37 CET]

Excelente work guy! You are the best! I would like to ask you, is possible to upload some files skipping by date and time file creation?

Many thanks.
#187 - siggy [2015-10-17 00:44:42 CET]

for msg #183 - Ron [2015-07-19 10:11:36 CET]

it seems to me you typed a wrong dollar sign before chmod (the one in the documentation is part of the shell prompt)
#188 - siggy [2015-10-17 01:01:41 CET]

for msg #182 - Nnako [2015-07-04 19:58:04 CET]

as far as I know if you need to catch the output from a process spawned from python you should use the
subprocess.popen instead of os.system
#189 - minimoto [2015-11-13 17:09:57 CET]

Thanks for great work. I have been using dropbox_uploader.sh for more than a year, and today first time I got &quot;Error: Couldn't connect to host&quot; error.

I will update uploader script and try again, thanks again for your handwork.
#190 - Thomas [2015-12-05 21:59:31 CET]

Hallo Andrea, you're script work's like a charm.
I use our on my PI together with the MOTION program.
If a motion is detected, a video is stored in my Dropbox.
If the bad guy steals also my pi, I have the video....
#191 - Thomas [2015-12-05 22:06:29 CET]

on_movie_end &quot;/home/pi/scripts/alarm_dropbox.sh %f&quot;

filename=$(basename $1)
/home/pi/scripts/dropbox_uploader.sh upload $1 $filename
#192 - Peter [2016-01-04 04:34:33 CET]

Thanks for your great work. Works perfectly on my Raspberry Pi!
#193 - Brian [2016-01-09 13:57:21 CET]

Any way to delete files based on creation date? Using this to clear out security video files older than 1 day etc....

#194 - security-dood [2016-01-09 22:18:06 CET]

In order to use this on Tails Live OS, you have to enable socks proxy. Uncomment the curl location and add your socks parameters so it will be used in every instance curl is invoked.

Change this:
To this:
CURL_BIN=&quot;/usr/bin/curl --socks;
#195 - Michael W [2016-01-25 18:18:34 CET]

@gward (comment #16), @Greg (comment #118), and @Brian (comment #193) - Here's a bash script I wrote that shows one way of deleting old files in your Dropbox: &lt;a href=&quot;https://gist.github.com/mwender/6b17f9927d40e37c1dbf&quot;&gt;https://gist.github.com/mwender/6b17f9927d40e37c1dbf&lt;/a&gt;
#196 - Michael W. [2016-01-25 19:29:52 CET]

Here's the link that got mangled in my previous comment:

#197 - Tobi W. [2016-02-01 21:36:20 CET]

Hey guy!
Great work, for me your script handles quite good.
But one problem accured: my file size is only 45 bytes and empty.

How is this possible? I get the feedback:

bash ~/backupme.sh
Archiving folders
Uploading archive to DropBox
&gt; Uploading &quot;/var/backups/2016/02/2016.02.01.tgz&quot; to &quot;/Backup/2016/02/2016.02.01.tgz&quot;... DONE
rm: cannot remove `/var/backups/2016/02': Is a directory

Then the file is a .tgz, when i unzip it, it is a .tar, and this file is empty.

Do you know help?

Thanks a lot
#198 - Tobi W. [2016-02-02 19:41:50 CET]

heres my config file, i'm not sure where there is a mistake...

#!/usr/bin/env bash
BACKUP_SRC=&quot;/opt/fhem/ /etc/pilight/&quot;
BACKUP_DST=&quot;/var/backups/$(date +&quot;%Y&quot;)/$(date +&quot;%m&quot;)&quot;
DROPBOX_DST=&quot;/Backup/$(date +&quot;%Y&quot;)/$(date +&quot;%m&quot;)&quot;
#MYSQL_PASS=&quot;your MySQL pass&quot;

NOW=$(date +&quot;%Y.%m.%d&quot;)

#echo -e &quot;Backing up MySQL databases&quot;
#mysqldump -u $MYSQL_USER -h $MYSQL_SERVER -p$MYSQL_PASS --all-databases &gt; &quot;/tm$

echo -e &quot;Archiving folders&quot;
sudo mkdir -p $BACKUP_DST
sudo tar -zcf &quot;$DESTFILE&quot; --exclude=&quot;$BACKUP_EXLUDE&quot; $BACKUP_SRC

echo -e &quot;Uploading archive to DropBox&quot;
~/dropbox_uploader.sh upload &quot;$DESTFILE&quot; &quot;$DROPBOX_DST/$NOW.tgz&quot;


echo -e &quot;Finished&quot;

thanks for the help
#199 - Tobi W. [2016-02-06 20:58:11 CET]

can someone help please? thanks a lot
#200 - Craig [2016-02-12 17:28:08 CET]


Loving your work.

Can you tell me please does the -s switch compare by file name or by modification date?

In other words will it replace newer versions of the file with the same same?

#201 - Ralph Peters [2016-02-23 00:48:21 CET]

It uploads files partially and then dies, usually not in the same place (see below). Occasionally it runs to completion. The total size of the files is about 500K. I have fairly good internet speed -- 40 Mbps down and 6 Mbps up. Do you have any idea how to make this mostly reliable?? I have tried 6 times and I had only failure. Speed is not important to me as I do it 3 times per day using cron.


2 Outputs below:

/home/pi/Dropbox-Uploader/dropbox_uploader.sh upload /var/www/weewx .

&gt; Creating Directory &quot;/weewx&quot;... ALREADY EXISTS
&gt; Creating Directory &quot;/weewx/backgrounds&quot;... ALREADY EXISTS
&gt; Uploading &quot;/var/www/weewx/backgrounds/band.gif&quot; to &quot;/weewx/backgrounds/band.gif&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/daybarometer.png&quot; to &quot;/weewx/daybarometer.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/dayinside.png&quot; to &quot;/weewx/dayinside.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/dayrain.png&quot; to &quot;/weewx/dayrain.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/dayrx.png&quot; to &quot;/weewx/dayrx.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/daytempchill.png&quot; to &quot;/weewx/daytempchill.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/daytempdew.png&quot; to &quot;/weewx/daytempdew.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/daywinddir.png&quot; to &quot;/weewx/daywinddir.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/daywind.png&quot; to &quot;/weewx/daywind.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/daywindvec.png&quot; to &quot;/weewx/daywindvec.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/favicon.ico&quot; to &quot;/weewx/favicon.ico&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/index.html&quot; to &quot;/weewx/index.html&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/mobile.css&quot; to &quot;/weewx/mobile.css&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/mobile.html&quot; to &quot;/weewx/mobile.html&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/monthbarometer.png&quot; to &quot;/weewx/monthbarometer.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/month.html&quot; to &quot;/weewx/month.html&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/monthinside.png&quot; to &quot;/weewx/monthinside.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/monthrain.png&quot; to &quot;/weewx/monthrain.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/monthrx.png&quot; to &quot;/weewx/monthrx.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/monthtempchill.png&quot; to &quot;/weewx/monthtempchill.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/monthtempdew.png&quot; to &quot;/weewx/monthtempdew.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/monthwinddir.png&quot; to &quot;/weewx/monthwinddir.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/monthwind.png&quot; to &quot;/weewx/monthwind.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/monthwindvec.png&quot; to &quot;/weewx/monthwindvec.png&quot;...
Error: Couldn't connect to host.
Another time:
/home/pi/Dropbox-Uploader/dropbox_uploader.sh upload /var/www/weewx .
&gt; Creating Directory &quot;/weewx&quot;... ALREADY EXISTS
&gt; Creating Directory &quot;/weewx/backgrounds&quot;... ALREADY EXISTS
&gt; Uploading &quot;/var/www/weewx/backgrounds/band.gif&quot; to &quot;/weewx/backgrounds/band.gif&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/daybarometer.png&quot; to &quot;/weewx/daybarometer.png&quot;... DONE
&gt; Uploading &quot;/var/www/weewx/dayinside.png&quot; to &quot;/weewx/dayinside.png&quot;...
Error: Couldn't connect to host.
#202 - Http://1337admin.org [2016-04-10 23:03:13 CET]

Ralph, try running Wireshark on the machine while it's doing the upload and see if there are a lot of retransmits. It could be the routes between your ISP and Dropbox. You can also run pathping from DOS to the destination IP's that you identify in your Wireshark capture. Most Internet providers don't care if they have bad routing but if you complain a lot they may change the traffic for you but it depends on your plan with them, SLA, etc. Someone should think of a way to tie in Bittorrent Sync into Dropbox. This would potentially solve most connectivity issues.
#203 - John Kings [2016-04-17 04:40:53 CET]

does it work with the unlimited business dropbox? Thanks!
#204 - Nnako [2016-04-17 16:36:05 CET]

I'd like to check a file's creation or modification date before actually downloading it from the dropbox server to my local machine. As far as I see, there is no way to list further file information except their class (D or F), size and name.

Is this right? Could this be implemented?
#205 - chris [2016-04-29 02:52:17 CET]

When downloading or uploading is there a way to check if existing files are newer / older and skip them accordingly?
#206 - sina [2016-05-04 12:08:17 CET]

Great script. Great work! Thank you!
#207 - Marcos [2016-06-20 11:40:58 CET]

Thank you, very useful!
#208 - Arthur [2016-06-29 01:38:16 CET]

Just got an email this morning that v1 of the dropbox API will cease to function:

&quot;Hi Arthur,

On June 28, 2017, API v1 will be turned off.

Please sign in to the Dropbox Platform website by September 28, 2016, and acknowledge that you’re aware of the deprecation.&quot;

This script is based on v1, so unless the entire thing is redone sometime in the next year it will stop working.
This script has worked faithfully for 6 years otherwise. :P
#209 - Dominique [2016-06-30 09:27:35 CET]

I want to confirm what Arthur said, I also got that email.

There's a whole year left until they'll stop the API version, so I hope you can rewrite this amazing script, as it's been doing all the backups on my servers for years now and I'd be puzzled how to solve this when your script was no longer working.
#210 - Vlad [2016-07-04 18:00:02 CET]

Uploading files to Dropbox causes download bandwidth is 10 times larger than upload. For example: I upload 1GB of data, provider measures 1G up and 10G down. So script pulls data back from Dropbox during upload. Could you, pls, fix it? With limited bandwidth it is impossible to use script.
Thank you
#211 - Peter [2016-08-18 10:25:40 CET]

I deployed the script on a Raspberry Pi and an x64 desktop (the OS is Debian Jessie on both), and all of the functions work. I can list and download files from the specified folder, also able to create directories. The only problem I have is that the upload only works for very small (~10 kB) text files. When I try to upload bigger text files or images it never completes. Modifying the user rights didn’t help. Can anyone tell me what is wrong?
#212 - Andrea [2016-08-18 10:26:55 CET]

@Peter, please open an issue on github
#213 - Ed [2016-08-21 21:34:49 CET]

@Peter, did you try to change a setting in the &quot;dropbox_uploader.sh&quot;, the setting SHOW_PROGRESSBAR=1. This will show you, if there is any progress on the upload at all. Maybe it only seems to not finish, because you cannot see the progress.
#214 - Jonathan [2016-08-25 15:26:30 CET]

Excellent! Works like a charm.

Email: (Will not appear online)
Security Code: