Aller au contenu. | Aller à la navigation

Outils personnels

Navigation

Vous êtes ici : Accueil / Espace utilisateurs/trices / Logiciels / OneDrive / Comment installer OneDrive sur Linux

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

  • Ouvrir Terminal et saisir les lignes de commandes
 

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:
  • Ouvrir un navigateur et copier l'URI dans le champ adresse du navigateur
  • Choisir "Work or school account"
  • Copier l'URI reçu depuis le champ d'adresse du navigateur
  • Coller l'URI dans la réponse du Terminal
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.

  • Synchroniser tous les fichiers et dossiers
onedrive --synchroniser --verbose --enable-loging
  • Ou bien synchroniser un seul dossier, dans cet exemple le dossier "Documents"
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
Configuring Global Azure AD Endpoints
Initializing the Synchronization Engine ...
Syncing changes from OneDrive ...
Creating local directory: Documents
Downloading file Documents/onedrived-dev-master.zip ... done.
Downloading file Documents/Attestation_de_deplacement_derogatoire.pdf ... done.
...

Downloading file Bureau/Shortcut/UNIFLOW - pwserver.url ... done.
Downloading file Bureau/Shortcut/SharePoint/SharePoint - Gestion des cartes multiservices.url ... done.
Downloading file Images/VPN.png ... done.
Downloading file Images/PackageManuel_VPN.png ... done.
Downloading file Pièces jointes/uniFlow-2024.zip ... done.
Uploading differences of ~/OneDrive
Uploading new items of ~/OneDrive
umarc@umarc-VirtualBox:~$ onedrive

Vérifier la configuration

onedrive --display-config

umarc@umarc-VirtualBox:~$ onedrive --display-config
onedrive version                       = v2.4.13-1build1
Config path                            = /home/umarc/.config/onedrive
Config file found in config path       = false
Config option 'check_nosync'           = false
Config option 'sync_dir'               = /home/umarc/OneDrive
Config option 'skip_dir'               =
Config option 'skip_file'              = ~*|.~*|*.tmp
Config option 'skip_dotfiles'          = false
Config option 'skip_symlinks'          = false
Config option 'monitor_interval'       = 300
Config option 'min_notify_changes'     = 5
Config option 'log_dir'                = /var/log/onedrive/
Config option 'classify_as_big_delete' = 1000
Config option 'upload_only'            = false
Config option 'no_remote_delete'       = false
Config option 'remove_source_files'    = false
Config option 'sync_root_files'        = false
Selective sync 'sync_list' configured  = false
Business Shared Folders configured     = false

Vérifier le journal

journalctl --user-unit onedrive -f

umarc@umarc-VirtualBox:~$ journalctl --user-unit onedrive -f
Nov 01 14:30:05 umarc-VirtualBox onedrive[3298]: Configuring Global Azure AD Endpoints
Nov 01 14:30:06 umarc-VirtualBox onedrive[3298]: Initializing the Synchronization Engine ...
Nov 01 14:30:06 umarc-VirtualBox onedrive[3298]: Initializing monitor ...
Nov 01 14:30:06 umarc-VirtualBox onedrive[3298]: OneDrive monitor interval (seconds): 300
Nov 01 14:50:54 umarc-VirtualBox onedrive[3298]: Starting a sync with OneDrive
Nov 01 14:50:54 umarc-VirtualBox onedrive[3298]: Syncing changes from OneDrive ...
Nov 01 14:50:56 umarc-VirtualBox onedrive[3298]: Sync with OneDrive is complete
Nov 01 15:16:03 umarc-VirtualBox onedrive[3298]: Starting a sync with OneDrive
Nov 01 15:16:03 umarc-VirtualBox onedrive[3298]: Syncing changes from OneDrive ...
Nov 01 15:16:05 umarc-VirtualBox onedrive[3298]: Sync with OneDrive is complete

 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
  • Cliquer sur "Activities" si présent sur le bureau
  • Saisir dans la barre de recherche : startup
  • Cliquer sur l'application
  • Cliquer sur le bouton Add
  • Saisir le nom voulu, dans cet exemple : "Auto start OneDrive Sync Service"
  • Saisir la commande : "systemctl --user start onedrive"
  • Cliquer sur le bouton Add et le bouton Close
  • Fermer la session et se loger
  • Ouvrir Teminal et saisir
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.

 

Actions sur le document