Notice: Taking Ubuntu 20.04 as an example, the selected three-party Microsoft To-Do software is abraunegg / onedrive
-
Installation: It is recommended to read the official tutorial directly . For convenience, I moved Ubuntu 20.04 over. For other distributions, you need to find them in the official tutorial.
wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/Release.key | sudo apt-key add - echo 'deb https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/ ./' | sudo tee /etc/apt/sources.list.d/onedrive.list sudo apt-get update sudo apt install onedrive
PS: If there is such a Note in the official tutorial, you need to be careful not to install it directly from the apt mirror source (because it is deprecated), you need to follow the official tutorial (that is, the Instructions under the red box)
-
Login account: Run the command on the terminal
onedrive
, copy and paste the URL displayed in the terminal into the browser, and then log in to the Microsoft account. After successful login, copy and paste the last URL into the terminal, and it will display success -
Set the configuration file: download the config file in the warehouse
~/.config/onedrive
to the path- The file synchronization path can modify the sync_dir parameter in the config file
- The update interval can modify the monitor_interval parameter in the config file
-
Synchronize again: confirm that there is no problem with the account
onedrive --synchronize
-
Set boot autostart: see official documentation for details
- general user
systemctl --user enable onedrive systemctl --user start onedrive # 查看日志 journalctl --user-unit=onedrive -f
- root user
systemctl enable onedrive systemctl start onedrive # 查看日志 journalctl --unit=onedrive -f
-
To turn on automatic sync:
onedrive --monitor
PS: If an error is reported
Too Many Open files error
, there is a high probability that the number of files in OneDrive exceeds the number of system file handles. You need to add the following content/etc/security/limits.conf
at the end of the file (before # End of file) , then restart* soft nofile 65535 * hard nofile 65535
Reference tutorial:
[Linux] Use Onedrive to automatically synchronize files under Linux, and deepin system uses abraunegg/onedrive