Scroll to navigation

ONEDRIVE(1) User Commands ONEDRIVE(1)

NAME

onedrive - folder synchronization with OneDrive

SYNOPSIS

onedrive [OPTION] --synchronize
onedrive [OPTION] --monitor
onedrive [OPTION] --display-config
onedrive [OPTION] --display-sync-status

DESCRIPTION

A complete tool to interact with OneDrive on Linux.

OPTIONS

Without any option given, no sync is done and the program exits.

Perform authorization via two files passed in as ARG in the format authUrl:responseUrl. The authorization URL is written to the authUrl, then onedrive waits for the file responseUrl to be present, and reads the response from that file.
Check for the presence of .nosync in the syncdir root. If found, do not perform sync.
Configuration file key: check_nomount (default: false)
Check for the presence of .nosync in each directory. If found, skip directory from sync.
Configuration file key: check_nosync (default: false)
Set the directory used to store the configuration files
Create a directory on OneDrive - no sync will be performed.
Destination directory for renamed or move on OneDrive - no sync will be performed.
Debug OneDrive HTTPS communication.
Configuration file key: debug_https (default: false)
Do not use desktop notifications in monitor mode
Configuration file key: disable_notifications (default: false)
Disable upload validation when uploading to OneDrive
Configuration file key: disable_upload_validation (default: false)
Display what options the client will use as currently configured - no sync will be performed.
Display the sync status of the client - no sync will be performed.
Only download remote changes
Configuration file key: download_only (default: false)
Perform a trial sync with no changes made. Can ONLY be used with --synchronize. Will be ignored for --monitor
Configuration file key: dry_run (default: false)
Enable client activity to a separate log file
Configuration file key: enable_logging (default: false)
Force the use of HTTP 1.1 for all operations
Configuration file key: force_http_11 (default: false)
Query and return the Office 365 Drive ID for a given Office 365 SharePoint Shared Library
Synchronize from the local directory source first, before downloading changes from OneDrive.
Configuration file key: local_first (default: false)
Logout the current user
defines the directory where logging output is saved to, needs to end with a slash
Configuration file key: log_dir (default: /var/log/onedrive/)
the minimum number of pending incoming changes necessary to trigger a desktop notification
Configuration file key: min_notify_changes (default: 5)
Keep monitoring for local and remote changes
The number of seconds by which each sync operation is undertaken when idle under monitor mode
Configuration file key: monitor_interval (default: 45)
Number of sync runs before performing a full local scan of the synced directory
Configuration file key: monitor_fullscan_frequency (default: 10)
Do not delete local file 'deletes' from OneDrive when using --upload-only
Configuration file key: no_remote_delete (default: false)
Print the access token, useful for debugging
Forget the last saved state, perform a full sync
Remove a directory on OneDrive - no sync will be performed.
Specify a single local directory within the OneDrive root to sync.
Skip dot files and folders from syncing
Configuration file key: skip_dotfiles (default: false)
Skip any files that match this pattern from syncing
Configuration file key: skip_file (default: ~*|.~*|*.tmp)
Skip syncing of symlinks
Configuration file key: skip_symlinks (default: false)
Source directory to rename or move on OneDrive - no sync will be performed.
Sync all files in sync_dir root when using sync_list.
Set the directory used to sync the files that are synced
Configuration file key: sync_dir (default: ~/OneDrive)
Perform a synchronization
Only upload to OneDrive, do not sync changes from OneDrive locally
Configuration file key: upload_only (default: false)
Print more details, useful for debugging. Given two times (or more) enables even more verbose debug statements.
Print the version and exit
This help information.

FEATURES

State caching

Real-Time file monitoring with Inotify

Resumable uploads

Support OneDrive for Business (part of Office 365)

Shared folders (OneDrive Personal)

SharePoint / Office 365 Group Drives (refer to README.Office365.md to configure)

CONFIGURATION

You should copy the default config file into your home directory before making changes:


mkdir -p ~/.config/onedrive
cp @DOCDIR@/config ~/.config/onedrive/config

For the supported options see the above list of command line options for the availability of a configuration key.

Pattern are case insensitive. * and ? wildcards characters are supported. Use | to separate multiple patterns.

After changing the filters (skip_file or skip_dir in your configs) you must execute onedrive --synchronize --resync.

FIRST RUN

After installing the application you must run it at least once from the terminal to authorize it.

You will be asked to open a specific link using your web browser where you will have to login into your Microsoft Account and give the application the permission to access your files. After giving the permission, you will be redirected to a blank page. Copy the URI of the blank page into the application.

SYSTEMD INTEGRATION

Service files are installed into user and system directories.

To enable this mode, run as root user

systemctl enable onedrive
systemctl start onedrive

This mode allows starting the OneDrive service automatically with system start for multiple users. For each <username> run:

systemctl enable onedrive@<username>
systemctl start onedrive@<username>

In this mode the service will be started when the user logs in. Run as user

systemctl --user enable onedrive
systemctl --user start onedrive

LOGGING OUTPUT

When running onedrive all actions can be logged to a separate log file. This can be enabled by using the --enable-logging flag. By default, log files will be written to /var/log/onedrive.

All logfiles will be in the format of %username%.onedrive.log, where %username% represents the user who ran the client.

NOTIFICATIONS

If OneDrive has been compiled with support for notifications, a running onedrive in monitor mode will send notifications about initialization and errors via libnotify to the dbus.

Note that this does not work if onedrive is started as root for a user via the onedrive@<username> service.

SEE ALSO

Further examples and documentation is available in README.md README.Office365.md

June 2019 2.3.4