Ubuntu – Multiple OneDrive accounts on Ubuntu 18.04 LTS

18.04configurationmicrosoft

I am a total newb here. I have two OneDrive accoutns, one for work and the other for personal use. How can I set up OneDrive in Ubuntu 18.04 to sync both accounts?

Best Answer

  • I use OneDrive Free Client. When setting it up, be sure to complete the Configuration and OneDrive service steps.

    We can now set up multiple accounts. Start by making a new local onedrive and .config

    mkdir ~/OneDriveWork && mkdir ~/.config/onedriveWork && cp ~/.config/onedrive/config ~/.config/onedriveWork/
    

    edit sync_dir in the config file to sync_dir = "~/OneDriveWork"

    nano .config/onedriveWork/config
    

    Copy the service you have created in the initial setup

    cp /usr/lib/systemd/user/onedrive.service /usr/lib/systemd/user/onedriveWork.service
    

    Edit the new service configuration directory

    sudo nano /usr/lib/systemd/user/onedriveWork.service
    

    add --confdir="~/.config/onedriveWork" to the end of ExecStart=/usr/local/bin/onedrive -m

    add onedriveWork service to autostart

    systemctl --user enable onedriveWork && systemctl --user start onedriveWork
    

    run onedrive and repeat the first time run instructions, similar to the initial setup, this time with your work account login.

    onedrive --monitor --confdir="~/.config/onedriveWork

    Reboot

    Hope this helps!

  • Related Question