In this installation tutorial, we will learn how setup Dropbox on the Linux server with the help of the command line. We are using CentOS 8 to install Dropbox.
Dropbox is one of the famous and most used file hosting services all over the world, Dropbox is referred to as a cloud storage service. User can save their personal and professional data on Dropbox. Dropbox offers a very secure platform for its users. Dropbox is one of the oldest cloud storage platforms. Nowadays, there are many alternatives are available such as Google Drive, OneDrive, etc.
Prerequisite
- Linux based Server (CentOS, Ubuntu, Debian and Red hat).
- Root user or other User with sudo privileges.
Installation
Create Access on dropbox
- Login to the Dropbox apps from here.
Enter your login details.
- After login, click on the
Create
button.
- Select
Scoped Access
option.
- Select
App folder
if you want to allow the user to access a particular directory, no other files and directories can be access by this user. To allow the user to access all the files and Directories in the Dropbox, then select theFull Dropbox
option.
- Create a name for you Dropbox app.
- Select
No Expiration
option in Access token expiration.
- Now click on Permissions to set the permission on the App user.
- Allow all the permission under the
Files and Folders
.
Click on Submit
the button, And then move to the server’s terminal.
Configuration on server
- Update the server
yum update -y
- Install Git package.
yum install git -y
- Change your current working directory to root directory.
cd /root/
- Create clone with the Git command.
git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
- Now change the current working directory to
Dropbox-Uploader
cd Dropbox-Uploader
- Allow execution permission
.sh
files.
sudo chmod +x *.sh
- Run the script. It will ask for the
App key
.
./dropbox_uploader.sh
- Move to the Dropbox app section, copy App Key and paste the key on the terminal.
- Now enter the
App secret
code.
- Click on on
show
. Copy and paste the App secret code on the terminal.
- After entering the
App secret
code, you will receive a link. Copy the link and paste on the Browser. After pasting the URL in the browser, click on continue button.
- Click on
Allow
button. Copy the access code and paste on the terminal.
- Now it will ask to confirm the Details. Type
Y
and press Enter button.
We have successfully connected Dropbox with our server. Now we can easily upload or download data from Dropbox.
Read Also: Find and Replace in Vim Editor
Note :-
If you want to configure the same Dropbox app on another server, then simply copy the content of /root/.dropbox_uploader
file and create the same file at the same path and with the same file name on the server. And, download and install the Dropbox package as mentioned above.
In this process, we did not require verifying the Dropbox package again from Dropbox.
Syntax of ./dropbox_uploader.sh
Commands:-
upload <LOCAL_FILE/DIR ...> <REMOTE_FILE/DIR> download <REMOTE_FILE/DIR> [LOCAL_FILE/DIR] delete <REMOTE_FILE/DIR> move <REMOTE_FILE/DIR> <REMOTE_FILE/DIR> copy <REMOTE_FILE/DIR> <REMOTE_FILE/DIR> mkdir <REMOTE_DIR> list [REMOTE_DIR] monitor [REMOTE_DIR] [TIMEOUT] share <REMOTE_FILE> saveurl <URL> <REMOTE_DIR> search <QUERY> info To check the information of the files or Directories space To check the space unlink To unlink the app
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
- To create the directory on the Dropbox, issue this below command.
./dropbox_uploader.sh mkdir Directory_Name
- To upload the file or directory on the Dropbox.
./dropbox_uploader.sh upload /Source/or/Directory /Destination/Path
Conclusion
In this setup Dropbox on the Linux server tutorial, we have learned how to set up Dropbox on the server with the command line. And learned how to download and upload data and directories on Dropbox.
While following the guide, if there is any problem while following the guide, just comment in the comment box below.
Leave a Reply