Follow https://www.maketecheasier.com/sync-onedrive-linux/ step-by-step.
[tuyen@g73jh ~]$ sudo dnf install -y libcurl-devel [sudo] password for tuyen: Docker CE Stable - x86_64 10 kB/s | 3.5 kB 00:00 Fedora 30 openh264 (From Cisco) - x86_64 317 B/s | 543 B 00:01 Fedora Modular 30 - x86_64 5.6 kB/s | 7.9 kB 00:01 Fedora Modular 30 - x86_64 - Updates 6.2 kB/s | 7.4 kB 00:01 Fedora 30 - x86_64 - Updates 8.1 kB/s | 7.5 kB 00:00 Fedora 30 - x86_64 - Updates 340 kB/s | 2.4 MB 00:07 Fedora 30 - x86_64 8.7 kB/s | 8.0 kB 00:00 packages-microsoft-com-prod 7.3 kB/s | 2.9 kB 00:00 RPM Fusion for Fedora 30 - Free - Updates 7.5 kB/s | 15 kB 00:01 RPM Fusion for Fedora 30 - Free 3.2 kB/s | 2.6 kB 00:00 RPM Fusion for Fedora 30 - Nonfree - Updates 14 kB/s | 15 kB 00:01 RPM Fusion for Fedora 30 - Nonfree 8.9 kB/s | 16 kB 00:01 skype (stable) 2.3 kB/s | 2.9 kB 00:01 virtio-win builds roughly matching what was shi 1.5 kB/s | 3.0 kB 00:02 Fedora 30 - x86_64 - VirtualBox 246 B/s | 181 B 00:00 Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: libcurl-devel x86_64 7.65.3-4.fc30 updates 812 k Transaction Summary ================================================================================ Install 1 Package Total download size: 812 k Installed size: 1.3 M Downloading Packages: libcurl-devel-7.65.3-4.fc30.x86_64.rpm 1.0 MB/s | 812 kB 00:00 -------------------------------------------------------------------------------- Total 542 kB/s | 812 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : libcurl-devel-7.65.3-4.fc30.x86_64 1/1 Running scriptlet: libcurl-devel-7.65.3-4.fc30.x86_64 1/1 Verifying : libcurl-devel-7.65.3-4.fc30.x86_64 1/1 Installed: libcurl-devel-7.65.3-4.fc30.x86_64 Complete! [tuyen@g73jh ~]$
[tuyen@g73jh ~]$ sudo dnf install -y sqlite-devel Last metadata expiration check: 0:01:06 ago on Tue 01 Oct 2019 11:31:30 AM +07. Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: sqlite-devel x86_64 3.26.0-6.fc30 updates 144 k Transaction Summary ================================================================================ Install 1 Package Total download size: 144 k Installed size: 576 k Downloading Packages: sqlite-devel-3.26.0-6.fc30.x86_64.rpm 82 kB/s | 144 kB 00:01 -------------------------------------------------------------------------------- Total 55 kB/s | 144 kB 00:02 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : sqlite-devel-3.26.0-6.fc30.x86_64 1/1 Running scriptlet: sqlite-devel-3.26.0-6.fc30.x86_64 1/1 Verifying : sqlite-devel-3.26.0-6.fc30.x86_64 1/1 Installed: sqlite-devel-3.26.0-6.fc30.x86_64 Complete! [tuyen@g73jh ~]$
[tuyen@g73jh ~]$ curl -fsS https://dlang.org/install.sh | bash -s dmd Downloading https://dlang.org/d-keyring.gpg ######################################################################## 100.0% Downloading https://dlang.org/install.sh ######################################################################## 100.0% gpg: directory '/home/tuyen/.gnupg' created gpg: keybox '/home/tuyen/.gnupg/pubring.kbx' created gpg: /home/tuyen/.gnupg/trustdb.gpg: trustdb created The latest version of this script was installed as ~/dlang/install.sh. It can be used it to install further D compilers. Run `~/dlang/install.sh --help` for usage information. Downloading and unpacking http://downloads.dlang.org/releases/2.x/2.088.0/dmd.2.088.0.linux.tar.xz ######################################################################## 100.0% Using dub 1.17.0 shipped with dmd-2.088.0 Run `source ~/dlang/dmd-2.088.0/activate` in your shell to use dmd-2.088.0. This will setup PATH, LIBRARY_PATH, LD_LIBRARY_PATH, DMD, DC, and PS1. Run `deactivate` later on to restore your environment. [tuyen@g73jh ~]$
[tuyen@g73jh onedrive]$ cd [tuyen@g73jh ~]$ source ~/dlang/dmd-2.088.0/activate
[tuyen@g73jh opt]$ sudo git clone https://github.com/abraunegg/onedrive.git Cloning into 'onedrive'... remote: Enumerating objects: 51, done. remote: Counting objects: 100% (51/51), done. remote: Compressing objects: 100% (49/49), done. remote: Total 3402 (delta 27), reused 2 (delta 2), pack-reused 3351 Receiving objects: 100% (3402/3402), 2.04 MiB | 1.46 MiB/s, done. Resolving deltas: 100% (2315/2315), done. [tuyen@g73jh opt]$
(dmd-2.088.0)[tuyen@g73jh onedrive]$ su -l Password: [root@g73jh ~]#
[root@g73jh onedrive]# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for dmd... dmd checking version of D compiler... 2.087.1 checking for curl... yes checking for sqlite... yes configure: creating ./config.status config.status: creating Makefile config.status: creating contrib/pacman/PKGBUILD config.status: creating contrib/spec/onedrive.spec config.status: creating onedrive.1 config.status: creating contrib/systemd/onedrive.service config.status: creating contrib/systemd/onedrive@.service [root@g73jh onedrive]#
[root@g73jh onedrive]# make if [ -f .git/HEAD ] ; then \ git describe --tags > version ; \ else \ echo v2.3.10-dev > version ; \ fi dmd -w -g -O -J. -L-lcurl -L-lsqlite3 -L-ldl src/config.d src/itemdb.d src/log.d src/main.d src/monitor.d src/onedrive.d src/qxor.d src/selective.d src/sqlite.d src/sync.d src/upload.d src/util.d src/progress.d -ofonedrive [root@g73jh onedrive]#
[root@g73jh onedrive]# make install /usr/bin/install -c -D onedrive /usr/local/bin/onedrive /usr/bin/install -c -D onedrive.1 /usr/local/share/man/man1/onedrive.1 /usr/bin/install -c -D -m 644 contrib/logrotate/onedrive.logrotate /usr/local/etc/logrotate.d/onedrive mkdir -p /usr/local/share/doc/onedrive /usr/bin/install -c -D -m 644 README.md config LICENSE CHANGELOG.md docs/Docker.md docs/INSTALL.md docs/Office365.md docs/USAGE.md /usr/local/share/doc/onedrive /usr/bin/install -c -d -m 0755 /usr/lib/systemd/user /usr/lib/systemd/system /usr/bin/install -c -m 0644 contrib/systemd/onedrive@.service /usr/lib/systemd/system /usr/bin/install -c -m 0644 contrib/systemd/onedrive.service /usr/lib/systemd/user [root@g73jh onedrive]#
[tuyen@g73jh ~]$ which onedrive /usr/local/bin/onedrive [tuyen@g73jh ~]$
[tuyen@g73jh ~]$ onedrive Authorize this app visiting: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.ReadWrite.All%20offline_access&response_type=code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient Enter the response uri: https://login.microsoftonline.com/common/oauth2/nativeclient?code=Maxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --synchronize or --monitor missing from your command options or use --help for further assistance No OneDrive sync will be performed without either of these two arguments being present [tuyen@g73jh ~]$
Configuration
[tuyen@g73jh onedrive]$ cp config ~/.config/onedrive/config
[tuyen@g73jh ~]$ onedrive --display-config onedrive version = v2.3.9-17-g0fef942 Config path = /home/tuyen/.config/onedrive Config file found in config path = true Config option 'check_nosync' = false Config option 'sync_dir' = /home/tuyen/OneDrive Config option 'skip_dir' = Config option 'skip_file' = ~*|.~*|*.tmp Config option 'skip_dotfiles' = false Config option 'skip_symlinks' = false Config option 'monitor_interval' = 45 Config option 'min_notify_changes' = 5 Config option 'log_dir' = /var/log/onedrive/ Config option 'sync_root_files' = false Selective sync configured = false [tuyen@g73jh ~]$
Create '.config/onedrive/sync_list' file if you want to synchronize selected folder.
[tuyen@g73jh ~]$ touch .config/onedrive/sync_list