Comment installer OneDrive sur Linux
Contexte et prérequis
Microsoft ne propose pas de solution clé en main pour l'utilisation de OneDrive sur Linux. L'installation du client OneDrive à partir du référentiel Debian Ubuntu permet de synchroniser en local les fichiers et dossiers OneDrive. Cet article a été testé sur la distribution Ubuntu.
Environnement
- Solution : OneDrive
- Système d'exploitation : Ubuntu 22.04
Comment faire
|
|
Installer le client OneDrive à partir du référentiel Debian ou Ubuntu. sudo apt-get install --yes onedrive |
umarc@umarc-VirtualBox:~$ sudo apt-get install --yes onedrive Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: libllvm11 libphobos2-ldc-shared98 The following NEW packages will be installed: libllvm11 libphobos2-ldc-shared98 onedrive 0 upgraded, 3 newly installed, 0 to remove and 8 not upgraded. Need to get 0 B/21.7 MB of archives. After this operation, 92.3 MB of additional disk space will be used. Selecting previously unselected package libllvm11:amd64. (Reading database ... 192702 files and directories currently installed.) Preparing to unpack .../libllvm11_1%3a11.1.0-6_amd64.deb ... Unpacking libllvm11:amd64 (1:11.1.0-6) ... Selecting previously unselected package libphobos2-ldc-shared98:amd64. Preparing to unpack .../libphobos2-ldc-shared98_1%3a1.28.0-1ubuntu1_amd64.deb ... Unpacking libphobos2-ldc-shared98:amd64 (1:1.28.0-1ubuntu1) ... Selecting previously unselected package onedrive. Preparing to unpack .../onedrive_2.4.13-1build1_amd64.deb ... Unpacking onedrive (2.4.13-1build1) ... Setting up libllvm11:amd64 (1:11.1.0-6) ... Setting up libphobos2-ldc-shared98:amd64 (1:1.28.0-1ubuntu1) ... Setting up onedrive (2.4.13-1build1) ... Created symlink /etc/systemd/user/default.target.wants/onedrive.service → /usr/lib/systemd/user/onedrive.service. Processing triggers for man-db (2.10.2-1) ... Processing triggers for libc-bin (2.35-0ubuntu3.8) ... |
Connecter le client à votre compte OneDrive. onedrive
|
umarc@umarc-VirtualBox:~$ onedrive Configuring Global Azure AD Endpoints Authorize this app visiting: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.All%20Sites.ReadWrite.All%20offline_access&response_type=code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient Enter the response uri: |
|
|
|
|
|
umarc@umarc-VirtualBox:~$ onedrive Configuring Global Azure AD Endpoints Authorize this app visiting: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d50ca740-c83f-4d1b-b616-12c519384f0c&scope=Files.ReadWrite%20Files.ReadWrite.all%20Sites.Read.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=1.AUgAw0Hf2gvvY0-ef0xXc7r4kUCnDNU_yBtNthYSxRk4TwwzAABIAA.AgABBAIAAADW6jl31mB3T7ugrWTT8pFeAwDs_wUA9P8xvHJOhtAQU2kZGY982Jw-e5hXsDygvNcBAwGS8WGKEpXkybU8WhnPEnjCwT5Emr2XF9dPNDe2pRd5VurYnsUgBvCj2YNWE1u2Tousme3mTKt5f6pqRQhetyz0-mvUfzyD4DrF-WsG5V5Ws3u1p59OQOCKdWcApo1gYjJWOy95YANhvxvLdyLipUtRyM7t-ZYbm5pIRpj4I-o2_o1ShrrnUhVU2xSFzs7JcPOCkdCXAqfue_pF38bngN-AsBgkecjA2Og8QX5NnbiXpnBe5LrLl7fuPNXx_FTUkOgjf3K30S_xjIjdSotGHYsMeVpjRdysBGMaKg5Owm7ZSe1lxMlsekFP3ttXBkfdnTfWnr2GOEKacYR_4fx8swVlY0tZ6r5GLIG7h_AqXkiR7156UTvoetVsb6GrWFEWirw6jIwL_8JbLgIVyKippnbR_wJXiAHKwaKJWcTeeLAlKliAG9ATzR_Ga4iDFAGXkEr5b6LtdhFA7O_Bu1bUGMQy4mDXeN1LKTcqGfiwzMk3ALIX2Z8oqDSjFMTwgYymAosVosbUXu-0QXpUnpH1V_2MYKIP1-wREPMkBD2V7O5YsFikTsmc0VnL0rOL809-Tqyg-EkLa7zDl5h19-ISxmv5URB2PQ8fRI8LNzKJczSVhjM96zoqThrMINM31Nq_RTiTyviuljaXB_Eml5u8J70eVmENHQoG4bD_6mHU7dybiuVu5mKLWCvAfEC3SxnEREAqsnUlITExiaT7VrgFnh6qNFIe9CJKjc65ZqoaLTnu0t8dYrwNo6aP-bLDd1SQoc8O4y9BEcnBpy_UuKVjeCHaJIegBPHv-r9oo07n2SMguSjqQyWrGQaMhPkGcFH73b4lB2IdegGbFhRmRChvfR74EOjlxw&session_state=084f5f70-4c54-4554-9356-03805041e4ad Application has been successfully authorised, however no additional command switches were provided. Please use --help for further assistance in regards to running this application. |
Synchroniser les dossiers et fichiers en local.
onedrive --synchroniser --verbose --enable-loging
onedrive --synchronize --single-directory "Documents" --verbose --enable-loging
Attendre la fin de la copie Création d'un fichier "onedrive.log" dans le dossier courant |
marc@umarc-VirtualBox:~$ onedrive --synchronize Downloading file Bureau/Shortcut/UNIFLOW - pwserver.url ... done. |
Vérifier la configuration onedrive --display-config
|
umarc@umarc-VirtualBox:~$ onedrive --display-config |
Vérifier le journal journalctl --user-unit onedrive -f
|
umarc@umarc-VirtualBox:~$ journalctl --user-unit onedrive -f |
Configurer le lancement automatique pour l'utilisateur courant systemctl --user enable onedrive systemctl --user start onedrive |
umarc@umarc-VirtualBox:~$ systemctl --user enable onedrive umarc@umarc-VirtualBox:~$ systemctl --user start onedrive |
|
|
|
|
pidof onedrive Un numéro PID doit s'afficher |
umarc@umarc-VirtualBox:~$ pidof onedrive 6199 |
Le répertoire local OneDrive se trouve dans le Home de l'utilisateur.
|