Setup of Linux OneDrive on CentOS 7


Introduction:
Sometime, you have a huge data sets to transfer and you may not want to hold an active connection all the time. One solution is to use OneDrive especially if you or your organisation has subscribed to Office 365. You should have 1TB of online space.

Step 1: Install Dependencies

yum install libcurl-devel
yum install sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd

Step 2: Git Clone the OneDrive Code

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
make
sudo make install

Step 3a: Authorize Microsoft to access your account

You need to authorize onedrive with Microsoft so it can access your account. First start by typing on the console

onedrive

Step 3b: You will be prompted to visit the URL to get permission

Step 4: Log in to your OneDrive account, and grant the app permission to access your account

Step 5: You will see a blank white page. Copy the URL and paste it into the Xterm

Step 6: Copy the URL and paste it into the Xterm  “Enter the response uri”


 Configuration

By default, all files are downloaded in ~/OneDrive and hidden files are skipped.  If you want to change the defaults, you can copy and edit the included config file into your ~/.config/onedrive directory:

mkdir -p ~/.config/onedrive
cp ./config ~/.config/onedrive/config
nano ~/.config/onedrive/config

Available options:

  • sync_dir: directory where the files will be synced
  • skip_file: any files or directories that match this pattern will be skipped during sync.

For example,

If I want to sync everything except Confidential and Personal Folders

# Directory where the files will be synced
sync_dir = "~/OneDrive/"
# Skip files and directories that match this pattern
skip_file = ".*|Confidential|Personal"

Note: after changing the sync list, you must perform a full synchronization by executing

onedrive --resync

 


One Drive Service

If you want to sync your files automatically, enable and start the systemd service:

systemctl --user enable onedrive
systemctl --user start onedrive

References:

  1. OneDrive Free Client
  2. How to Sync Microsoft OneDrive with Linux

One thought on “Setup of Linux OneDrive on CentOS 7

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.