|
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

Excellent script ! Exactly what I needed. Thanks !
Thanks1
Just what I was looking for!!! Thank you.
Muchas Gracias. Thanks a lot friend. You save me
www.maravento.com
Great job!
Thanks!
Finally I'm somewhat able to use Dropbox on my arm-server! Thanks a lot!
/Mikkel
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.
This is perfect, except it stumbles on folders with spaces, even when enclosed with quotations.
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.
Give us RSS or e-mail alert when new versions published
For anyone getting "Failed" when uploading, maybe this will save you some time :)
Max file size: 300MB.
Using this in conjunction with tar to backup my /etc and /var/www folders to dropbox. LOVE IT!!!!
Good work, man! Nice script.
But can you modify this script to receive public url of uploaded files? It would be perfect!
happily using it, thanks for sharing!!
Letting you know I've made an Arch Linux pkgbuild for script.
Hope you do not mind, I really enjoy using it.
http://aur.archlinux.org/packages.php?ID=45309
please, put it to github!
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.
Thanks!
Thank you for the great script! Please add an option to limit upload speed, used in shared bandwidth network.
spettacolare...
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...
Thanks
Lemur
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
What an excellent and useful piece of code. Thank you very much!!!
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 ?
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!
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.
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.
Excellent, thats a good script! keep it up!
Thank you very much, Im agree with #26, it will be better if restore or sync the folders.
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?
Excellent! Thank you very much!
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
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)..
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.
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!
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 :-)
Jean
Thanks for the script! Just stumbled upon this and I\'ll definitely be using it in the future.
Thanks :)
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.
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.
Hi,
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?
@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).
I agree with Timido :)
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?
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;
Yes, it work well, thank you very much. I would suggest to add this function on next version.
Why not use this?
https://www.dropbox.com/developers/reference/api#chunked-upload
@B
Is in the roadmap.
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.
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
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/>
@Steve
Thanks for your suggestion.
Try to change the default config file path with the absolute path (/home/user/.dropbox_uploader).
Andrea
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,
Steve
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.
Great job, thanks for this!
Could you also please implement the move command?
Great script! use it all the time!
Now I want to use it on OpenWrt. Had to replace stat by "wc -c" but still run into "An error occurred requesting /commit_chunked_upload".
U have any idea why this is?
Thanks, nice script. Keep life simple ;)
For non-English files, we should encode/decode the file name to UFT-8 first, use convmv or other command.
eg:
convmv -f gb2312 -t utf-8 --notest 测试.zip
@Marco I had the same problem. The cause is the incompatibility of the "sed" version of busybox. The solution was simple:
- install sed (opkg update; opkg install sed)
- edit the script, replace "sed" with "/usr/bin/sed"
Chunk upload not working in freebsd 8.3. please fix it :(
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 "An error occurred requesting /commit_chunked_upload"
Se qualcuno avesse suggerimenti.. grazie ad Andrea per lo script
usando la versione precedente dello script (senza i chunk files) funziona anche l'upload..Olè
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?
Great script! Thank you!
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! ;)
Thank you very much! Very usefull script. Work good on FreeBSD 8.3 but can't work as cron job :(
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
Hello,
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.
https://www.dropbox.com/s/yroz3hisj24p6j0/dropbox_uploader.sh
thank you.
hi,
great script, I use it on my openwrt-box.
1. I'm not shure if I can replace "stat" with "wc -c", but anyway, I need the script for downloading
2. I use Pau's (comment #66) script with the "sync" command, great.
but now two questions:
A. how can I adapt the script that I can give a destination folder for "sync" (=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 "sync" (=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
Excellent Scrip!... but I think I may have found a bug...?
Create a file simply called " H" 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 " H"
This returns with a "FAILED" 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.
Awesome script, thanks a lot for your great work.
Works great. Using it on Centos 6.3 and on a hacked Pandigital 6" eReader.
Pretty nice.
Thanks for making this and putting it up.
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?
@Diego: i have fixed the link, thanks.
Yes, you can schedule the script using crontab.
root@moon:~# ./dropbox_uploader.sh
: No such file or directory
how is that possible? The file exists and is executable!
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
How can i upload a entire directory?
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!
Thank you soooooooooooooooooooooooooooooooooooooooo much!! You made my day
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 :-)
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!
You are my Hero !!!!1
Thanks for the hard work.
This script is awesome. Really helped me get a large file out from a place with a crappy network connection. Thanks for sharing!!
Thank you! I've used this to upload images from my Raspberry Pi "security"-cam. It worked right away, and exceeded my expectations.
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.
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 "Error: this script requires BASH shell!". 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? :)
great job,man!
will be usefull! thank you
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?
Awesome work. I can finally fine tune my backups with DropBox :)
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?
Brilliant! Just what I needed!