droxul

Droxul

A Command-line tool to access Dropbox for linux and GitBash

Install

# Install 
npm i droxul --g


Install your Dropbox API Key

Usage:

#upload
droxul upload mybackup.tar.gz /backups/mybackup.tar.gz 
droxul list /
droxul download /backups/mybackup.tar.gz

# Most commands have shell-familiar aliases: put, get, ls, rm, mv, cp, df ...
droxul ls /
droxul put mybackup.tar.gz /backups/

# Upload and get the share link in one step
droxul upload-share notes.pdf /shared/
droxul upln notes.pdf /shared/ -D   # direct-download link
droxul upld notes.pdf /shared/      # same thing, -D implied
# ... Type only droxul on the prompt

Full Usage list

Dropbox Uploader v1.0
Andrea Fabrizi - andrea.fabrizi@gmail.com
Packaged and distributed by: Guillaume Descoteaux-Isabelle,2018-2020

Usage: droxul [PARAMETERS] COMMAND...

Commands:
         upload       <LOCAL_FILE/DIR ...> <REMOTE_FILE/DIR>    (alias: put)
         download     <REMOTE_FILE/DIR> [LOCAL_FILE/DIR]        (alias: get)
         delete       <REMOTE_FILE/DIR>                         (aliases: remove, rm, del)
         move         <REMOTE_FILE/DIR> <REMOTE_FILE/DIR>       (aliases: rename, mv)
         copy         <REMOTE_FILE/DIR> <REMOTE_FILE/DIR>       (alias: cp)
         mkdir        <REMOTE_DIR>
         list         [REMOTE_DIR]                              (aliases: ls, dir)
         monitor      [REMOTE_DIR] [TIMEOUT]
         share        <REMOTE_FILE> [-D|--download]             (alias: link)
         upload-share <LOCAL_FILE/DIR> <REMOTE_FILE/DIR> [-D]   (alias: upln)
         upld         <LOCAL_FILE/DIR> <REMOTE_FILE/DIR>        (= upln -D, alias: uplnd)
         saveurl      <URL> <REMOTE_DIR>                        (aliases: wget, fetch)
         search       <QUERY>                                   (alias: find)
         info                                                   (aliases: whoami, account)
         space                                                  (aliases: free, df)
         unlink

Optional parameters:
        -f <FILENAME> Load the configuration file from a specific file
        -s            Skip already existing files when download/upload. Default: Overwrite
        -d            Enable DEBUG mode
        -q            Quiet mode. Don't show messages
        -h            Show file sizes in human readable format
        -p            Show cURL progress meter
        -k            Doesn't check for SSL certificates (insecure)
        -x            Ignores/excludes directories or files from syncing. -x filename -x directoryname. example: -x .git
        -D, --download  For 'share': return a direct-download link (dl=1) instead of a preview link (dl=0)
        --help, /?    Show this help

For more info and examples, please see the README file.

Bellow is credit and refs —

based on: Dropbox Uploader

Dropbox Uploader is a BASH script which can be used to upload, download, delete, list files (and more!) from Dropbox, an online file sharing, synchronization and backup service.

It’s written in BASH scripting language and only needs cURL.

You can take a look to the GiHub project page.

Why use this script?

Please refer to the Wiki for tips and additional information about this project. The Wiki is also the place where you can share your scripts and examples related to Dropbox Uploader.

Features

Getting started

First, clone the repository using git (recommended):

git clone https://github.com/andreafabrizi/Dropbox-Uploader.git

or download the script manually using this command:

curl "https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o dropbox_uploader.sh

Then give the execution permission to the script and run it:

 $chmod +x dropbox_uploader.sh
 $./dropbox_uploader.sh

The first time you run dropbox_uploader, you’ll be guided through a wizard in order to configure access to your Dropbox. This configuration will be stored in ~/.dropbox_uploader.

Usage

The syntax is quite simple:

./dropbox_uploader.sh [PARAMETERS] COMMAND...

[%%]: Optional param
<%%>: Required param

Available commands:

Optional parameters:

Examples:

    ./dropbox_uploader.sh upload /etc/passwd /myfiles/passwd.old
    ./dropbox_uploader.sh upload *.zip /
    ./dropbox_uploader.sh -x .git upload ./project /
    ./dropbox_uploader.sh download /backup.zip
    ./dropbox_uploader.sh delete /backup.zip
    ./dropbox_uploader.sh mkdir /myDir/
    ./dropbox_uploader.sh upload "My File.txt" "My File 2.txt"
    ./dropbox_uploader.sh share "My File.txt"
    ./dropbox_uploader.sh share "My File.txt" --download
    ./dropbox_uploader.sh list

Tested Environments

If you have successfully tested this script on others systems or platforms please let me know!

Running as cron job

Dropbox Uploader relies on a different configuration file for each system user. The default configuration file location is $HOME/.dropbox_uploader. This means that if you setup the script with your user and then you try to run a cron job as root, it won’t work. So, when running this script using cron, please keep in mind the following:

How to setup a proxy

To use a proxy server, just set the https_proxy environment variable:

Linux:

    export HTTP_PROXY_USER=XXXX
    export HTTP_PROXY_PASSWORD=YYYY
    export https_proxy=http://192.168.0.1:8080

BSD:

    setenv HTTP_PROXY_USER XXXX
    setenv HTTP_PROXY_PASSWORD YYYY
    setenv https_proxy http://192.168.0.1:8080

BASH and Curl installation

Debian & Ubuntu Linux:

    sudo apt-get install bash (Probably BASH is already installed on your system)
    sudo apt-get install curl

BSD:

    cd /usr/ports/shells/bash && make install clean
    cd /usr/ports/ftp/curl && make install clean

Cygwin:
You need to install these packages:

Before running the script, you need to convert it using the dos2unix command.

Build cURL from source:

DropShell

DropShell is an interactive DropBox shell, based on DropBox Uploader:

DropShell v0.2
The Intractive Dropbox SHELL
Andrea Fabrizi - andrea.fabrizi@gmail.com

Type help for the list of the available commands.

andrea@Dropbox:/$ ls
 [D] 0       Apps
 [D] 0       Camera Uploads
 [D] 0       Public
 [D] 0       scripts
 [D] 0       Security
 [F] 105843  notes.txt
andrea@DropBox:/ServerBackup$ get notes.txt

Running as Docker Container

First build the docker image:

docker build https://github.com/sircuri/Dropbox-Uploader.git -f Dockerfile -t <TAG>

or for RaspBerry:

docker build https://github.com/sircuri/Dropbox-Uploader.git -f Dockerfile.pi -t <TAG>

then, you can run it as following:

docker run -i --rm --user=$(id -u):$(id -g) -v <LOCAL_CONFIG_PATH>:/config -v <YOUR_DATA_DIR_MOUNT>:/workdir <TAG> <Arguments> 

This will store the auth token information in the given local directory in <LOCAL_CONFIG_PATH>. To ensure access to your mounted directories it can be important to pass a UID and GID to the docker deamon (as stated in the example by the –user argument)

Using the script with docker makes it also possible to run the script even on windows machines.

To use a proxy, just set the mentioned environment variables via the docker -e parameter.

thunar-dropbox: A simple extension to Dropbox Uploader that provides a convenient method to share your Dropbox files with one click!

Donations

If you want to support this project, please consider donating: