Dropbox Uploader is a bash script that allows you to perform various actions on your Dropbox (upload, download, delete, share, etc.) without installing the Dropbox client. This is useful for servers, automatic backups or accessing Dropbox from ARM devices, like Raspberry Pi.
The script was updated recently, getting a copy function, a "-s" option to skip existing files when uploading/downloading (files are overwritten by default), along with other changes.
Here are the changes in the latest Dropbox Uploader 0.12:
- added copy function;
- added -s option to skip existing files when upload/download;
- fixed problem uploading twice the same directory;
- add checking for not allowed file names;
- handling connection/resolving host errors;
- better error handling;
- converted if condition to BASH native syntax;
- added normalize_path function, to canonicalize paths;
- removed check for free quota on every file upload to improve performance;
- added checks for file permissions before writing/reading files on the local fs;
- fixed unicode problem in file listing;
- many other minor changes and improvements.
Since our last article about Dropbox Uploader, the script has received numerous improvements, including support for downloading and uploading directories, move/rename function and more.
The latest Dropbox Uploader 0.12 supports the following commands: upload, download, delete, move, copy, mkdir, list, share, info and unlink. There are also some optional parameters, like the newly added "-s" to skip already existing files when uploading or downloading, "-p" to show curl progress meter and more.
Download and install Dropbox Uploader
Dropbox Uploader depends on Bash and Curl. In Ubuntu, Bash is already installed and to install Curl, use the following command:
sudo apt-get install curl
Then, download and install Dropbox Uploader using the following commands:
curl "https://raw.github.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o /tmp/dropbox_uploader.sh
sudo install /tmp/dropbox_uploader.sh /usr/local/bin/dropbox_uploader
You can also grab the latest Dropbox Uploader with Git:
sudo apt-get install git
git clone https://github.com/andreafabrizi/Dropbox-Uploader/
Authorize Dropbox Uploader with your Dropbox account
The first time you run Dropbox Uploader, you'll need to authorize it with your Dropbox account. To do this, run Dropbox Uploader:
dropbox_uploader
Then visit https://www.dropbox.com/developers/apps, click "Create app", select "Dropbox API app" and:
- for the type of data select "Files and datastores";
- then choose if the app should be limited to a single folder or if it can access files already in your Dropbox;
- if you didn't limit the app to is own private folder, you can also select the file types it can access ;
- enter the app name provided by Dropbox Uploader.
Click "Create app" at the bottom and on the next page you should see your app key and secret which you need to enter in the terminal where you ran dropbox_uploader:
Now back to the terminal: select the access level you have chosen when creating the app and Dropbox Uploader will display a link you need to enter in your browser - visit the link, click "Allow" and finally, back to the terminal, press ENTER and you're done:
To see all the available commands, simply run:
dropbox_uploader
For more information, bug reports, etc., see the Dropbox Uploader GitHub page.
0 comments:
Post a Comment