mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Merge branch 'master' into implement-gui-integration
This commit is contained in:
commit
9dfcb44496
5 changed files with 280 additions and 137 deletions
166
docs/usage.md
166
docs/usage.md
|
|
@ -217,7 +217,7 @@ This behaviour is intended to improve data integrity and crash resilience, but i
|
|||
|
||||
#### How This Affects the OneDrive Client
|
||||
|
||||
Because Obsidian is constantly writing files, running the OneDrive Client for Linux in `--monitor` mode causes the client to continually receive inotify events. This leads to constant re-uploading of files, regardless of whether meaningful content has changed.
|
||||
Because Obsidian is constantly writing files, running the OneDrive Client for Linux in `--monitor` mode causes the client to continually receive inotify events from the local file system. This leads to constant re-uploading of files, regardless of whether meaningful content has changed.
|
||||
|
||||
The consequences of this are:
|
||||
|
||||
|
|
@ -227,12 +227,12 @@ The consequences of this are:
|
|||
|
||||
#### Recommendation
|
||||
|
||||
If you use Obsidian, it is *strongly* recommended that you enable the following two configuration options in your OneDrive client `config` file:
|
||||
If you use Obsidian, it is *strongly* recommended that you enable the following two configuration options in your OneDrive Client for Linux `config` file:
|
||||
```
|
||||
force_session_upload = "true"
|
||||
delay_inotify_processing = "true"
|
||||
```
|
||||
These settings introduce a delay in processing local file change events, allowing the OneDrive client to batch or debounce Obsidian's frequent writes. By default, this delay is 5 seconds.
|
||||
These settings introduce a delay in processing local file change events, allowing the OneDrive Client for Linux to batch or debounce Obsidian's frequent writes. By default, this delay is 5 seconds.
|
||||
|
||||
To adjust this delay, you can add the following configuration option:
|
||||
```
|
||||
|
|
@ -245,6 +245,14 @@ This example sets the delay to 10 seconds.
|
|||
>
|
||||
> Adjust this setting with extreme caution and test thoroughly to ensure it does not impact your workflow or data integrity.
|
||||
|
||||
> [!TIP]
|
||||
> An Obsidian Plugin also exists to 'control' the auto save behaviour of Obsidian.
|
||||
>
|
||||
> Instead of saving every two seconds from start of typing (Obsidian default), this plugin makes Obsidian wait for the user to finish with editing, and after the input stops, it waits for a defined time (by default 10 seconds) and then it only saves once.
|
||||
>
|
||||
> For more information please read: https://github.com/mihasm/obsidian-autosave-control
|
||||
|
||||
|
||||
### Compatibility with curl
|
||||
If your system uses curl < 7.47.0, curl will default to HTTP/1.1 for HTTPS operations, and the client will follow suit, using HTTP/1.1.
|
||||
|
||||
|
|
@ -259,17 +267,17 @@ If you explicitly want to use HTTP/1.1, you can do so by using the `--force-http
|
|||
|----|----------|-----------------------|
|
||||
| 1 | HTTP/2 support: Introduced HTTP/2 support, enabling multiplexed transfers over a single connection | 7.47.0 |
|
||||
| 2 | HTTP/2 issue: Resolved an issue where HTTP/2 connections were not properly reused, leading to unnecessary new connections. | 7.68.0 |
|
||||
| 3 | HTTP/2 issue: Addressed a race condition in HTTP/2 multiplexing that could lead to unexpected behavior. | 7.74.0 |
|
||||
| 3 | HTTP/2 issue: Addressed a race condition in HTTP/2 multiplexing that could lead to unexpected behaviour. | 7.74.0 |
|
||||
| 4 | HTTP/2 issue: Improved handling of HTTP/2 priority frames to ensure proper stream prioritisation. | 7.81.0 |
|
||||
| 5 | HTTP/2 issue: Fixed a bug where HTTP/2 connections were prematurely closed, resulting in incomplete data transfers. | 7.88.1 |
|
||||
| 6 | HTTP/2 issue: Resolved a problem with HTTP/2 frame handling that could cause data corruption during transfers. | 8.2.1 |
|
||||
| 7 | HTTP/2 issue: Corrected an issue where HTTP/2 streams were not properly closed, leading to potential memory leaks. | 8.5.0 |
|
||||
| 8 | HTTP/2 issue: Addressed a bug where HTTP/2 connections could hang under specific conditions, improving reliability. | 8.8.0 |
|
||||
| 9 | HTTP/2 issue: Improved handling of HTTP/2 connections to prevent unexpected stream resets and enhance stability. | 8.9.0 |
|
||||
| 10 | SIGPIPE issue: Resolved a problem where SIGPIPE signals were not properly handled, leading to unexpected behavior. | 8.9.1 |
|
||||
| 10 | SIGPIPE issue: Resolved a problem where SIGPIPE signals were not properly handled, leading to unexpected behaviour. | 8.9.1 |
|
||||
| 11 | SIGPIPE issue: Addressed a SIGPIPE leak that occurred in certain cases starting with version 8.9.1 | 8.10.0 |
|
||||
| 12 | HTTP/2 issue: Stopped offering ALPN `http/1.1` for `http2-prior-knowledge` to ensure proper protocol negotiation. | 8.10.0 |
|
||||
| 13 | HTTP/2 issue: Improved handling of end-of-stream (EOS) and blocked states to prevent unexpected behavior.| 8.11.0 |
|
||||
| 13 | HTTP/2 issue: Improved handling of end-of-stream (EOS) and blocked states to prevent unexpected behaviour.| 8.11.0 |
|
||||
| 14 | OneDrive operation encountered an issue with libcurl reading the local SSL CA Certificates issue | 8.14.1 |
|
||||
|
||||
#### Known curl versions with compatibility issues for this client
|
||||
|
|
@ -716,10 +724,22 @@ onedrive --sync
|
|||
This will synchronise files from your Microsoft OneDrive account to your `~/OneDrive` local directory or to your specified 'sync_dir' location.
|
||||
|
||||
> [!TIP]
|
||||
> If you prefer to use your local files as stored in `~/OneDrive` as your 'source of truth,' use the following sync command:
|
||||
> #### Specifying the 'source of truth' for your synchronisation with Microsoft OneDrive
|
||||
> By default, the OneDrive Client for Linux treats your online OneDrive data as the source of truth. This means that when determining which version of a file should be trusted as authoritative, the client prioritises the state of files stored online over local copies.
|
||||
>
|
||||
> In some workflows, you may prefer to treat your local files as the primary reference instead — for example, when you regularly make changes locally and want those to take precedence during conflict resolution.
|
||||
>
|
||||
> To change this behaviour, enable the local-first mode by setting the configuration option in your `config` file:
|
||||
> ```text
|
||||
> local_first = "true"
|
||||
> ```
|
||||
> or by using the command-line argument at runtime:
|
||||
> ```text
|
||||
> onedrive --sync --local-first
|
||||
> ```
|
||||
>
|
||||
> When this option is enabled, the client will prioritise local data as the source of truth when comparing file differences and resolving synchronisation conflicts.
|
||||
>
|
||||
|
||||
### Performing a single directory synchronisation with Microsoft OneDrive
|
||||
In some cases, it may be desirable to synchronise a single directory under ~/OneDrive without having to change your client configuration. To do this, use the following command:
|
||||
|
|
@ -1165,25 +1185,31 @@ If `--resync` is used, all resumable data is discarded intentionally.
|
|||
## Frequently Asked Configuration Questions
|
||||
|
||||
### How to change the default configuration of the client?
|
||||
Configuration is determined by three layers, and applied in the following order:
|
||||
* Application default values
|
||||
* Values that are set in the configuration file
|
||||
* Values that are passed in via the command line at application runtime. These values will override any configuration file set value.
|
||||
The OneDrive Client for Linux determines its configuration from three layers, applied in the following order of priority:
|
||||
|
||||
The default application values provide a reasonable operational default, and additional configuration is entirely optional.
|
||||
1. Application default values – internal defaults built into the client
|
||||
2. Configuration file values – user-defined settings from a config file (if present)
|
||||
3. Command-line arguments – values passed at runtime override both of the above
|
||||
|
||||
If you want to change the application defaults, you can download a copy of the config file into your application configuration directory. Valid default directories for the config file are:
|
||||
* `~/.config/onedrive`
|
||||
* `/etc/onedrive`
|
||||
The built-in application defaults are sufficient for most users and provide a reliable operational baseline. Adding a configuration file or command-line options is optional, and only required when you want to customise application runtime behaviour.
|
||||
|
||||
>[!NOTE]
|
||||
> The OneDrive Client does not create a configuration file automatically.
|
||||
> If no configuration file is found, the client runs entirely using its internally defined default values.
|
||||
> You only need to create a config file if you wish to override those defaults.
|
||||
|
||||
If you want to adjust the default settings, download a copy of the configuration template into your local configuration directory. Valid configuration file locations are:
|
||||
* `~/.config/onedrive` – for per-user configuration
|
||||
* `/etc/onedrive` – for system-wide configuration
|
||||
|
||||
> [!TIP]
|
||||
> To download a copy of the config file, use the following:
|
||||
> To download a copy of the default configuration template, run:
|
||||
> ```text
|
||||
> mkdir -p ~/.config/onedrive
|
||||
> wget https://raw.githubusercontent.com/abraunegg/onedrive/master/config -O ~/.config/onedrive/config
|
||||
> ```
|
||||
|
||||
For full configuration options and CLI switches, please refer to [application-config-options.md](application-config-options.md)
|
||||
For a full list of configuration options and command-line switches, see [application-config-options.md](application-config-options.md)
|
||||
|
||||
### How to change where my data from Microsoft OneDrive is stored?
|
||||
By default, the location where your Microsoft OneDrive data is stored, is within your Home Directory under a directory called 'OneDrive'. This replicates as close as possible where the Microsoft Windows OneDrive client stores data.
|
||||
|
|
@ -1590,9 +1616,9 @@ onedrive - A client for the Microsoft OneDrive Cloud Service
|
|||
|
||||
Usage:
|
||||
onedrive [options] --sync
|
||||
Do a one time synchronization
|
||||
Do a one-time synchronisation with Microsoft OneDrive
|
||||
onedrive [options] --monitor
|
||||
Monitor filesystem and sync regularly
|
||||
Monitor filesystem and synchronise regularly with Microsoft OneDrive
|
||||
onedrive [options] --display-config
|
||||
Display the currently used configuration
|
||||
onedrive [options] --display-sync-status
|
||||
|
|
@ -1604,79 +1630,83 @@ onedrive - A client for the Microsoft OneDrive Cloud Service
|
|||
|
||||
Options:
|
||||
|
||||
--auth-files ARG
|
||||
Perform authentication not via interactive dialog but via files read/writes to these files.
|
||||
--auth-response ARG
|
||||
Perform authentication not via interactive dialog but via providing the response url directly.
|
||||
--auth-files '<path or required value>'
|
||||
Perform authentication via files rather than an interactive dialogue. The application reads/writes the required values from/to the specified files
|
||||
--auth-response '<path or required value>'
|
||||
Perform authentication via a supplied response URL rather than an interactive dialogue
|
||||
--check-for-nomount
|
||||
Check for the presence of .nosync in the syncdir root. If found, do not perform sync.
|
||||
Check for the presence of .nosync in the syncdir root. If found, do not perform sync
|
||||
--check-for-nosync
|
||||
Check for the presence of .nosync in each directory. If found, skip directory from sync.
|
||||
--classify-as-big-delete ARG
|
||||
Check for the presence of .nosync in each directory. If found, skip directory from sync
|
||||
--classify-as-big-delete '<path or required value>'
|
||||
Number of children in a path that is locally removed which will be classified as a 'big data delete'
|
||||
--cleanup-local-files
|
||||
Cleanup additional local files when using --download-only. This will remove local data.
|
||||
--confdir ARG
|
||||
Clean up additional local files when using --download-only. This will remove local data
|
||||
--confdir '<path or required value>'
|
||||
Set the directory used to store the configuration files
|
||||
--create-directory ARG
|
||||
Create a directory on OneDrive - no sync will be performed.
|
||||
--create-share-link ARG
|
||||
--create-directory '<path or required value>'
|
||||
Create a directory on OneDrive. No synchronisation will be performed
|
||||
--create-share-link '<path or required value>'
|
||||
Create a shareable link for an existing file on OneDrive
|
||||
--debug-https
|
||||
Debug OneDrive HTTPS communication.
|
||||
--destination-directory ARG
|
||||
Destination directory for renamed or move on OneDrive - no sync will be performed.
|
||||
--destination-directory '<path or required value>'
|
||||
Destination directory for renamed or moved items on OneDrive. No synchronisation will be performed
|
||||
--disable-download-validation
|
||||
Disable download validation when downloading from OneDrive
|
||||
--disable-notifications
|
||||
Do not use desktop notifications in monitor mode.
|
||||
Do not use desktop notifications in monitor mode
|
||||
--disable-upload-validation
|
||||
Disable upload validation when uploading to OneDrive
|
||||
--display-config
|
||||
Display what options the client will use as currently configured - no sync will be performed.
|
||||
Display what options the client will use as currently configured. No synchronisation will be performed
|
||||
--display-quota
|
||||
Display the quota status of the client - no sync will be performed.
|
||||
Display the quota status of the client. No synchronisation will be performed
|
||||
--display-running-config
|
||||
Display what options the client has been configured to use on application startup.
|
||||
Display what options the client has been configured to use on application startup
|
||||
--display-sync-status
|
||||
Display the sync status of the client - no sync will be performed.
|
||||
Display the sync status of the client. No synchronisation will be performed
|
||||
--download-file '<path or required value>'
|
||||
Download a single file from Microsoft OneDrive
|
||||
--download-only
|
||||
Replicate the OneDrive online state locally, by only downloading changes from OneDrive. Do not upload local changes to OneDrive.
|
||||
Replicate the OneDrive online state locally, by only downloading changes from OneDrive. Do not upload local changes to OneDrive
|
||||
--dry-run
|
||||
Perform a trial sync with no changes made
|
||||
--enable-logging
|
||||
Enable client activity to a separate log file
|
||||
--file-fragment-size
|
||||
Specify the file fragment size for large file uploads (in MB)
|
||||
--force
|
||||
Force the deletion of data when a 'big delete' is detected
|
||||
--force-http-11
|
||||
Force the use of HTTP 1.1 for all operations
|
||||
--force-sync
|
||||
Force a synchronization of a specific folder, only when using --sync --single-directory and ignore all non-default skip_dir and skip_file rules
|
||||
--get-O365-drive-id ARG
|
||||
Force a synchronisation of a specific folder, only when using --sync --single-directory and ignore all non-default skip_dir and skip_file rules
|
||||
--get-O365-drive-id '<path or required value>'
|
||||
Query and return the Office 365 Drive ID for a given Office 365 SharePoint Shared Library (DEPRECATED)
|
||||
--get-file-link ARG
|
||||
--get-file-link '<path or required value>'
|
||||
Display the file link of a synced file
|
||||
--get-sharepoint-drive-id ARG
|
||||
--get-sharepoint-drive-id '<path or required value>'
|
||||
Query and return the Office 365 Drive ID for a given Office 365 SharePoint Shared Library
|
||||
--help -h
|
||||
This help information.
|
||||
--list-shared-items
|
||||
List OneDrive Business Shared Items
|
||||
--local-first
|
||||
Synchronize from the local directory source first, before downloading changes from OneDrive.
|
||||
--log-dir ARG
|
||||
Directory where logging output is saved to, needs to end with a slash.
|
||||
Synchronise from the local directory source first, before downloading changes from OneDrive
|
||||
--log-dir '<path or required value>'
|
||||
Directory where logging output is saved to, needs to end with a slash
|
||||
--logout
|
||||
Logout the current user
|
||||
--modified-by ARG
|
||||
Log out the current user
|
||||
--modified-by '<path or required value>'
|
||||
Display the last modified by details of a given path
|
||||
--monitor -m
|
||||
Keep monitoring for local and remote changes
|
||||
--monitor-fullscan-frequency ARG
|
||||
--monitor-fullscan-frequency '<path or required value>'
|
||||
Number of sync runs before performing a full local scan of the synced directory
|
||||
--monitor-interval ARG
|
||||
Number of seconds by which each sync operation is undertaken when idle under monitor mode.
|
||||
--monitor-log-frequency ARG
|
||||
--monitor-interval '<path or required value>'
|
||||
Number of seconds by which each sync operation is undertaken when idle under monitor mode
|
||||
--monitor-log-frequency '<path or required value>'
|
||||
Frequency of logging in monitor mode
|
||||
--no-remote-delete
|
||||
Do not delete local file 'deletes' from OneDrive when using --upload-only
|
||||
|
|
@ -1684,44 +1714,50 @@ onedrive - A client for the Microsoft OneDrive Cloud Service
|
|||
Print the access token, useful for debugging
|
||||
--reauth
|
||||
Reauthenticate the client with OneDrive
|
||||
--remove-directory ARG
|
||||
Remove a directory on OneDrive - no sync will be performed.
|
||||
--remove-directory '<path or required value>'
|
||||
Remove a directory on OneDrive. No synchronisation will be performed
|
||||
--remove-source-files
|
||||
Remove source file after successful transfer to OneDrive when using --upload-only
|
||||
--remove-source-folders
|
||||
Remove the local directory structure post successful file transfer to Microsoft OneDrive when using --upload-only --remove-source-files
|
||||
--resync
|
||||
Forget the last saved state, perform a full sync
|
||||
--resync-auth
|
||||
Approve the use of performing a --resync action
|
||||
--single-directory ARG
|
||||
Specify a single local directory within the OneDrive root to sync.
|
||||
--skip-dir ARG
|
||||
--share-password '<path or required value>'
|
||||
Require a password to access the shared link when used with --create-share-link <file>
|
||||
--single-directory '<path or required value>'
|
||||
Specify a single local directory within the OneDrive root to sync
|
||||
--skip-dir '<path or required value>'
|
||||
Skip any directories that match this pattern from syncing
|
||||
--skip-dir-strict-match
|
||||
When matching skip_dir directories, only match explicit matches
|
||||
--skip-dot-files
|
||||
Skip dot files and folders from syncing
|
||||
--skip-file ARG
|
||||
--skip-file '<path or required value>'
|
||||
Skip any files that match this pattern from syncing
|
||||
--skip-size ARG
|
||||
--skip-size '<path or required value>'
|
||||
Skip new files larger than this size (in MB)
|
||||
--skip-symlinks
|
||||
Skip syncing of symlinks
|
||||
--source-directory ARG
|
||||
Source directory to rename or move on OneDrive - no sync will be performed.
|
||||
--space-reservation ARG
|
||||
--source-directory '<path or required value>'
|
||||
Source directory to rename or move on OneDrive. No synchronisation will be performed
|
||||
--space-reservation '<path or required value>'
|
||||
The amount of disk space to reserve (in MB) to avoid 100% disk space utilisation
|
||||
--sync -s
|
||||
Perform a synchronisation with Microsoft OneDrive
|
||||
--sync-root-files
|
||||
Sync all files in sync_dir root when using sync_list.
|
||||
Sync all files in sync_dir root when using sync_list
|
||||
--sync-shared-files
|
||||
Sync OneDrive Business Shared Files to the local filesystem
|
||||
--syncdir ARG
|
||||
--syncdir '<path or required value>'
|
||||
Specify the local directory used for synchronisation to OneDrive
|
||||
--synchronize
|
||||
Perform a synchronisation with Microsoft OneDrive (DEPRECATED)
|
||||
--threads
|
||||
Specify a value for the number of worker threads used for parallel upload and download operations
|
||||
--upload-only
|
||||
Replicate the locally configured sync_dir state to OneDrive, by only uploading local changes to OneDrive. Do not download changes from OneDrive.
|
||||
Replicate the locally configured sync_dir state to OneDrive, by only uploading local changes to OneDrive. Do not download changes from OneDrive
|
||||
--verbose -v+
|
||||
Print more details, useful for debugging (repeat for extra debugging)
|
||||
--version
|
||||
|
|
|
|||
141
onedrive.1.in
141
onedrive.1.in
|
|
@ -20,68 +20,106 @@ onedrive \- A client for the Microsoft OneDrive Cloud Service
|
|||
.B onedrive
|
||||
--version
|
||||
.SH DESCRIPTION
|
||||
This is a free Microsoft OneDrive Client designed to work with OneDrive Personal, OneDrive for Business, Office365 OneDrive, and SharePoint Libraries. It's fully compatible with most major Linux distributions and FreeBSD, and can be containerised using Docker or Podman. The client offers secure one-way and two-way synchronisation capabilities, making it easy to connect to Microsoft OneDrive services across various platforms.
|
||||
A fully featured, free, and actively maintained Microsoft OneDrive client that seamlessly supports OneDrive Personal, OneDrive for Business, Microsoft 365 (formerly Office 365), and SharePoint document libraries.
|
||||
.PP
|
||||
Designed for maximum flexibility and reliability, this powerful and highly configurable client works across all major Linux distributions and FreeBSD. It can also be deployed in containerised environments using Docker or Podman. Supporting both one-way and two-way synchronisation modes, the client provides secure and efficient file syncing with Microsoft OneDrive services — tailored to suit both desktop and server environments.
|
||||
|
||||
.SH FEATURES
|
||||
.br
|
||||
* Compatible with OneDrive Personal, OneDrive for Business including accessing Microsoft SharePoint Libraries
|
||||
* Compatible with OneDrive Personal and OneDrive for Business, including access to Microsoft SharePoint Libraries
|
||||
.br
|
||||
* Supports seamless access to shared folders and files across both OneDrive Personal and OneDrive for Business accounts
|
||||
.br
|
||||
* Supports near real-time processing of online changes via either WebSockets (native support) or webhooks (manual configuration required)
|
||||
.br
|
||||
* Supports single-tenant and multi-tenant applications
|
||||
.br
|
||||
* Supports Intune Single Sign-On (SSO) authentication via the Microsoft Identity Device Broker (D-Bus interface)
|
||||
.br
|
||||
* Supports OAuth2 Device Authorisation Flow for Microsoft Entra ID accounts
|
||||
.br
|
||||
* Supports the FreeDesktop.org Trash specification, allowing locally deleted files to be safely recoverable in case of accidental online deletion
|
||||
.br
|
||||
* Supports national cloud deployments including Microsoft Cloud for US Government, Microsoft Cloud Germany, and Azure/Office 365 operated by VNET in China
|
||||
.br
|
||||
* Provides rules for client-side filtering to select data for syncing with Microsoft OneDrive accounts
|
||||
.br
|
||||
* Caches sync state for efficiency
|
||||
* Protects against significant data loss on OneDrive after configuration changes
|
||||
.br
|
||||
* Supports a dry-run option for safe configuration testing
|
||||
.br
|
||||
* Supports interruption-tolerant uploads and downloads by resuming file transfers from the point of failure, ensuring data integrity and efficiency
|
||||
.br
|
||||
* Validates file transfers to ensure data integrity
|
||||
.br
|
||||
* Caches sync state for efficiency
|
||||
.br
|
||||
* Monitors local files in real-time using inotify
|
||||
.br
|
||||
* Supports interrupted uploads for completion at a later time
|
||||
.br
|
||||
* Capability to sync remote updates immediately via webhooks
|
||||
.br
|
||||
* Enhanced synchronisation speed with multi-threaded file transfers
|
||||
.br
|
||||
* Manages traffic bandwidth use with rate limiting
|
||||
.br
|
||||
* Supports seamless access to shared folders and files across both OneDrive Personal and OneDrive for Business accounts
|
||||
.br
|
||||
* Supports national cloud deployments including Microsoft Cloud for US Government, Microsoft Cloud Germany, and Azure and Office 365 operated by VNET in China
|
||||
.br
|
||||
* Supports sending desktop alerts using libnotify
|
||||
.br
|
||||
* Protects against significant data loss on OneDrive after configuration changes
|
||||
.br
|
||||
* Works with both single and multi-tenant applications
|
||||
|
||||
.SH CONFIGURATION
|
||||
By default, the client will use a sensible set of default values to interact with the Microsoft OneDrive service.
|
||||
.TP
|
||||
Should you wish to change these defaults, you should copy the default config file into your home directory before making any applicable changes:
|
||||
By default, the OneDrive Client for Linux uses a sensible set of built-in defaults to interact with the Microsoft OneDrive service.
|
||||
|
||||
.PP
|
||||
The client determines its configuration from three layers, applied in the following order of priority:
|
||||
|
||||
.PP
|
||||
1. Application default values – internal defaults compiled into the client.
|
||||
.br
|
||||
2. Configuration file values – user-defined settings loaded from a configuration file (if present).
|
||||
.br
|
||||
3. Command-line arguments – values specified at runtime override both the configuration file and application defaults.
|
||||
.br
|
||||
.PP
|
||||
The built-in application defaults are sufficient for most users and provide a reliable operational baseline. Creating a configuration file or using command-line options is optional, and only required when you wish to customise runtime behaviour.
|
||||
|
||||
.TP
|
||||
.B NOTE:
|
||||
The OneDrive Client does not create a configuration file automatically. If no configuration file is found, the client runs entirely using its internally defined default values. You only need to create a configuration file if you wish to override those defaults.
|
||||
|
||||
.PP
|
||||
If you want to adjust the default settings, download a copy of the default configuration template into your local configuration directory.
|
||||
Valid configuration file locations are:
|
||||
.br
|
||||
.PP
|
||||
\fB~/.config/onedrive\fP – for per-user configuration.
|
||||
.br
|
||||
\fB/etc/onedrive\fP – for system-wide configuration.
|
||||
|
||||
.TP
|
||||
.B Example:
|
||||
To download a copy of the default configuration template, run:
|
||||
.PP
|
||||
.nf
|
||||
\fB
|
||||
mkdir\ \-p\ ~/.config/onedrive
|
||||
cp\ @DOCDIR@/config\ ~/.config/onedrive/config
|
||||
mkdir -p ~/.config/onedrive
|
||||
wget https://raw.githubusercontent.com/abraunegg/onedrive/master/config -O ~/.config/onedrive/config
|
||||
\fP
|
||||
.fi
|
||||
|
||||
.TP
|
||||
Please refer to the online documentation file application-config-options.md for details on all configuration file options.
|
||||
.PP
|
||||
For a full list of configuration options and command-line switches, refer to the online documentation:
|
||||
.br
|
||||
\fIhttps://github.com/abraunegg/onedrive/blob/master/docs/application-config-options.md\fP
|
||||
|
||||
.SH CLIENT SIDE FILTERING
|
||||
Client Side Filtering in the context of the OneDrive Client for Linux refers to user-configured rules that determine what files and directories the client should upload or download from Microsoft OneDrive. These rules are crucial for optimising synchronisation, especially when dealing with large numbers of files or specific file types. The OneDrive Client for Linux offers several configuration options to facilitate this:
|
||||
.TP
|
||||
.B skip_dir
|
||||
.B --skip-dir or 'skip_dir' config file option
|
||||
Specifies directories that should not be synchronised with OneDrive. Useful for omitting large or irrelevant directories from the sync process.
|
||||
.TP
|
||||
.B skip_dotfiles
|
||||
.B --skip-dot-files or 'skip_dotfiles' config file option
|
||||
Excludes dotfiles, usually configuration files or scripts, from the sync. Ideal for users who prefer to keep these files local.
|
||||
.TP
|
||||
.B skip_file
|
||||
.B --skip-file or 'skip_file' config file option
|
||||
Allows specifying specific files to exclude from synchronisation. Offers flexibility in selecting essential files for cloud storage.
|
||||
.TP
|
||||
.B skip_symlinks
|
||||
.B --skip-symlinks or 'skip_symlinks' config file option
|
||||
Prevents symlinks, which often point to files outside the OneDrive directory or to irrelevant locations, from being included in the sync.
|
||||
.PP
|
||||
Additionally, the OneDrive Client for Linux allows the implementation of Client Side Filtering rules through a 'sync_list' file. This file explicitly states which directories or files should be included in the synchronisation. By default, any item not listed in the 'sync_list' file is excluded. This approach offers granular control over synchronisation, ensuring that only necessary data is transferred to and from Microsoft OneDrive.
|
||||
|
|
@ -107,15 +145,15 @@ If the client has been compiled with support for notifications, the client will
|
|||
When running onedrive all actions can be logged to a separate log file. This can be enabled by using the \fB--enable-logging\fP flag. By default, log files will be written to \fB/var/log/onedrive\fP. All logfiles will be in the format of \fB%username%.onedrive.log\fP, where \fB%username%\fP represents the user who ran the client.
|
||||
|
||||
.SH ALL CLI OPTIONS
|
||||
The options below allow you to control the behavior of the onedrive client from the CLI. Without any specific option, if the client is already authenticated, the client will exit without any further action.
|
||||
The options below allow you to control the behaviour of the onedrive client from the CLI. Without any specific option, if the client is already authenticated, the client will exit without any further action.
|
||||
|
||||
.TP
|
||||
\fB\-\-sync\fR
|
||||
Do a one-time synchronisation with OneDrive.
|
||||
\fB\-\-sync\fR, -s
|
||||
Do a one-time synchronisation with Microsoft OneDrive.
|
||||
|
||||
.TP
|
||||
\fB\-\-monitor\fR
|
||||
Monitor filesystem for changes and sync regularly.
|
||||
\fB\-\-monitor\fR, -m
|
||||
Monitor filesystem and synchronise regularly with Microsoft OneDrive.
|
||||
|
||||
.TP
|
||||
\fB\-\-display-config\fR
|
||||
|
|
@ -127,14 +165,14 @@ Query OneDrive service and report on pending changes.
|
|||
|
||||
.TP
|
||||
\fB\-\-auth-files\fR \fIARG\fR
|
||||
Perform authentication not via interactive dialog but via files that are read/written when using this option. The two files are passed in as \fBARG\fP in the format \fBauthUrl:responseUrl\fP.
|
||||
Perform authentication not via interactive dialogue but via files that are read/written when using this option. The two files are passed in as \fBARG\fP in the format \fBauthUrl:responseUrl\fP.
|
||||
The authorisation URL is written to the \fBauthUrl\fP file, then \fBonedrive\fP waits for the file \fBresponseUrl\fP to be present, and reads the response from that file.
|
||||
.br
|
||||
Always specify the full path when using this option, otherwise the application will default to using the default configuration path for these files (~/.config/onedrive/)
|
||||
|
||||
.TP
|
||||
\fB\-\-auth-response\fR \fIARG\fR
|
||||
Perform authentication not via interactive dialog but via providing the response URL directly.
|
||||
Perform authentication not via interactive dialogue but via providing the response URL directly.
|
||||
|
||||
.TP
|
||||
\fB\-\-check-for-nomount\fR
|
||||
|
|
@ -150,7 +188,7 @@ Number of children in a path that is locally removed which will be classified as
|
|||
|
||||
.TP
|
||||
\fB\-\-cleanup-local-files\fR
|
||||
Cleanup additional local files when using --download-only. This will remove local data.
|
||||
Clean up additional local files when using --download-only. This will remove local data.
|
||||
|
||||
.TP
|
||||
\fB\-\-confdir\fR \fIARG\fR
|
||||
|
|
@ -158,11 +196,15 @@ Set the directory used to store the configuration files.
|
|||
|
||||
.TP
|
||||
\fB\-\-create-directory\fR \fIARG\fR
|
||||
Create a directory on OneDrive - no sync will be performed.
|
||||
Create a directory on OneDrive. No synchronisation will be performed.
|
||||
|
||||
.TP
|
||||
\fB\-\-create-share-link\fR \fIARG\fR
|
||||
Create a shareable link for an existing file on OneDrive.
|
||||
.br
|
||||
Use --with-editing-perms to create a read-write share link instead of read-only.
|
||||
.br
|
||||
Use --share-password <password> to protect the shared link with a password.
|
||||
|
||||
.TP
|
||||
\fB\-\-debug-https\fR
|
||||
|
|
@ -170,7 +212,7 @@ Debug OneDrive HTTPS communication.
|
|||
|
||||
.TP
|
||||
\fB\-\-destination-directory\fR \fIARG\fR
|
||||
Destination directory for renamed or moved items on OneDrive - no sync will be performed.
|
||||
Destination directory for renamed or moved items on OneDrive. No synchronisation will be performed.
|
||||
|
||||
.TP
|
||||
\fB\-\-disable-download-validation\fR
|
||||
|
|
@ -186,11 +228,13 @@ Disable upload validation when uploading to OneDrive.
|
|||
|
||||
.TP
|
||||
\fB\-\-display-quota\fR
|
||||
Display the quota status of the client - no sync will be performed.
|
||||
Display the quota status of the client. No synchronisation will be performed.
|
||||
|
||||
.TP
|
||||
\fB\-\-download-file\fR
|
||||
This CLI option will download a single file based on the online path. No sync will be performed.
|
||||
\fB\-\-download-file\fR \fIARG\fR
|
||||
Download a single file from Microsoft OneDrive.
|
||||
.br
|
||||
Specify the full online path to the file. No synchronisation will be performed.
|
||||
|
||||
.TP
|
||||
\fB\-\-display-running-config\fR
|
||||
|
|
@ -209,7 +253,7 @@ Perform a trial sync with no changes made.
|
|||
Enable client activity to a separate log file.
|
||||
|
||||
.TP
|
||||
\fB\-\-file-fragment-size\fR
|
||||
\fB\-\-file-fragment-size\fR \fIARG\fR
|
||||
Specify the file fragment size for large file uploads (in MB).
|
||||
|
||||
.TP
|
||||
|
|
@ -233,7 +277,7 @@ Query and return the Office 365 Drive ID for a given Office 365 SharePoint Share
|
|||
Display the file link of a synced file.
|
||||
|
||||
.TP
|
||||
\fB\-\-get-sharepoint-drive-id\fR
|
||||
\fB\-\-get-sharepoint-drive-id\fR \fIARG\fR
|
||||
Query and return the Office 365 Drive ID for a given Office 365 SharePoint Shared Library.
|
||||
|
||||
.TP
|
||||
|
|
@ -254,12 +298,16 @@ Directory where logging output is saved to, needs to end with a slash.
|
|||
|
||||
.TP
|
||||
\fB\-\-logout\fR
|
||||
Logout the current user.
|
||||
Log out the current user.
|
||||
|
||||
.TP
|
||||
\fB\-\-modified-by\fR \fIARG\fR
|
||||
Display the last modified by details of a given path.
|
||||
|
||||
.TP
|
||||
\fB\-\-monitor-fullscan-frequency\fR \fIARG\fR
|
||||
Number of sync runs before performing a full local scan of the synced directory.
|
||||
|
||||
.TP
|
||||
\fB\-\-monitor-interval\fR \fIARG\fR
|
||||
Number of seconds by which each sync operation is undertaken when idle under monitor mode.
|
||||
|
|
@ -282,7 +330,7 @@ Reauthenticate the client with OneDrive.
|
|||
|
||||
.TP
|
||||
\fB\-\-remove-directory\fR \fIARG\fR
|
||||
Remove a directory on OneDrive - no sync will be performed.
|
||||
Remove a directory on OneDrive. No synchronisation will be performed.
|
||||
|
||||
.TP
|
||||
\fB\-\-remove-source-files\fR
|
||||
|
|
@ -300,6 +348,11 @@ Forget the last saved state, perform a full sync.
|
|||
\fB\-\-resync-auth\fR
|
||||
Approve the use of performing a --resync action.
|
||||
|
||||
.TP
|
||||
\fB\-\-share-password\fR \fIARG\fR
|
||||
Require a password to access the shared link when used with --create-share-link <file>.
|
||||
Only supported for OneDrive Business and SharePoint environments that permit password-protected sharing.
|
||||
|
||||
.TP
|
||||
\fB\-\-single-directory\fR \fIARG\fR
|
||||
Specify a single local directory within the OneDrive root to sync.
|
||||
|
|
@ -330,7 +383,7 @@ Skip syncing of symlinks.
|
|||
|
||||
.TP
|
||||
\fB\-\-source-directory\fR \fIARG\fR
|
||||
Source directory to rename or move on OneDrive - no sync will be performed.
|
||||
Source directory to rename or move on OneDrive. No synchronisation will be performed.
|
||||
|
||||
.TP
|
||||
\fB\-\-space-reservation\fR \fIARG\fR
|
||||
|
|
|
|||
36
src/config.d
36
src/config.d
|
|
@ -708,7 +708,7 @@ class ApplicationConfig {
|
|||
}
|
||||
} else {
|
||||
// --dry-run scenario ... technically we should not be making any local file changes .......
|
||||
addLogEntry("DRY RUN: Not creating backup config file as --dry-run has been used");
|
||||
addLogEntry("DRY-RUN: Not creating backup config file as --dry-run has been used");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1178,10 +1178,10 @@ class ApplicationConfig {
|
|||
std.getopt.config.bundling,
|
||||
std.getopt.config.caseSensitive,
|
||||
"auth-files",
|
||||
"Perform authentication not via interactive dialog but via files read/writes to these files",
|
||||
"Perform authentication via files rather than an interactive dialogue. The application reads/writes the required values from/to the specified files",
|
||||
&stringValues["auth_files"],
|
||||
"auth-response",
|
||||
"Perform authentication not via interactive dialog but via providing the response url directly",
|
||||
"Perform authentication via a supplied response URL rather than an interactive dialogue",
|
||||
&stringValues["auth_response"],
|
||||
"check-for-nomount",
|
||||
"Check for the presence of .nosync in the syncdir root. If found, do not perform sync",
|
||||
|
|
@ -1193,10 +1193,10 @@ class ApplicationConfig {
|
|||
"Number of children in a path that is locally removed which will be classified as a 'big data delete'",
|
||||
&longValues["classify_as_big_delete"],
|
||||
"cleanup-local-files",
|
||||
"Cleanup additional local files when using --download-only. This will remove local data",
|
||||
"Clean up additional local files when using --download-only. This will remove local data",
|
||||
&boolValues["cleanup_local_files"],
|
||||
"create-directory",
|
||||
"Create a directory on OneDrive - no sync will be performed",
|
||||
"Create a directory on OneDrive. No synchronisation will be performed",
|
||||
&stringValues["create_directory"],
|
||||
"create-share-link",
|
||||
"Create a shareable link for an existing file on OneDrive",
|
||||
|
|
@ -1205,7 +1205,7 @@ class ApplicationConfig {
|
|||
"Debug OneDrive HTTPS communication.",
|
||||
&boolValues["debug_https"],
|
||||
"destination-directory",
|
||||
"Destination directory for renamed or move on OneDrive - no sync will be performed",
|
||||
"Destination directory for renamed or moved items on OneDrive. No synchronisation will be performed",
|
||||
&stringValues["destination_directory"],
|
||||
"disable-notifications",
|
||||
"Do not use desktop notifications in monitor mode",
|
||||
|
|
@ -1217,16 +1217,16 @@ class ApplicationConfig {
|
|||
"Disable upload validation when uploading to OneDrive",
|
||||
&boolValues["disable_upload_validation"],
|
||||
"display-config",
|
||||
"Display what options the client will use as currently configured - no sync will be performed",
|
||||
"Display what options the client will use as currently configured. No synchronisation will be performed",
|
||||
&boolValues["display_config"],
|
||||
"display-running-config",
|
||||
"Display what options the client has been configured to use on application startup",
|
||||
&boolValues["display_running_config"],
|
||||
"display-sync-status",
|
||||
"Display the sync status of the client - no sync will be performed",
|
||||
"Display the sync status of the client. No synchronisation will be performed",
|
||||
&boolValues["display_sync_status"],
|
||||
"display-quota",
|
||||
"Display the quota status of the client - no sync will be performed",
|
||||
"Display the quota status of the client. No synchronisation will be performed",
|
||||
&boolValues["display_quota"],
|
||||
"download-only",
|
||||
"Replicate the OneDrive online state locally, by only downloading changes from OneDrive. Do not upload local changes to OneDrive",
|
||||
|
|
@ -1250,7 +1250,7 @@ class ApplicationConfig {
|
|||
"Force the deletion of data when a 'big delete' is detected",
|
||||
&boolValues["force"],
|
||||
"force-sync",
|
||||
"Force a synchronization of a specific folder, only when using --sync --single-directory and ignore all non-default skip_dir and skip_file rules",
|
||||
"Force a synchronisation of a specific folder, only when using --sync --single-directory and ignore all non-default skip_dir and skip_file rules",
|
||||
&boolValues["force_sync"],
|
||||
"get-file-link",
|
||||
"Display the file link of a synced file",
|
||||
|
|
@ -1268,13 +1268,13 @@ class ApplicationConfig {
|
|||
"Sync OneDrive Business Shared Files to the local filesystem",
|
||||
&boolValues["sync_business_shared_files"],
|
||||
"local-first",
|
||||
"Synchronize from the local directory source first, before downloading changes from OneDrive",
|
||||
"Synchronise from the local directory source first, before downloading changes from OneDrive",
|
||||
&boolValues["local_first"],
|
||||
"log-dir",
|
||||
"Directory where logging output is saved to, needs to end with a slash",
|
||||
&stringValues["log_dir"],
|
||||
"logout",
|
||||
"Logout the current user",
|
||||
"Log out the current user",
|
||||
&boolValues["logout"],
|
||||
"modified-by",
|
||||
"Display the last modified by details of a given path",
|
||||
|
|
@ -1307,7 +1307,7 @@ class ApplicationConfig {
|
|||
"Approve the use of performing a --resync action",
|
||||
&boolValues["resync_auth"],
|
||||
"remove-directory",
|
||||
"Remove a directory on OneDrive - no sync will be performed",
|
||||
"Remove a directory on OneDrive. No synchronisation will be performed",
|
||||
&stringValues["remove_directory"],
|
||||
"remove-source-files",
|
||||
"Remove source file after successful transfer to OneDrive when using --upload-only",
|
||||
|
|
@ -1337,7 +1337,7 @@ class ApplicationConfig {
|
|||
"Skip syncing of symlinks",
|
||||
&boolValues["skip_symlinks"],
|
||||
"source-directory",
|
||||
"Source directory to rename or move on OneDrive - no sync will be performed",
|
||||
"Source directory to rename or move on OneDrive. No synchronisation will be performed",
|
||||
&stringValues["source_directory"],
|
||||
"space-reservation",
|
||||
"The amount of disk space to reserve (in MB) to avoid 100% disk space utilisation",
|
||||
|
|
@ -2122,7 +2122,7 @@ class ApplicationConfig {
|
|||
safeRemove(syncListHashFile);
|
||||
} else {
|
||||
// --dry-run scenario ... technically we should not be making any local file changes .......
|
||||
addLogEntry("DRY RUN: Not removing hash files as --dry-run has been used");
|
||||
addLogEntry("DRY-RUN: Not removing hash files as --dry-run has been used");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2159,7 +2159,7 @@ class ApplicationConfig {
|
|||
}
|
||||
} else {
|
||||
// --dry-run scenario ... technically we should not be making any local file changes .......
|
||||
addLogEntry("DRY RUN: Not updating hash files as --dry-run has been used");
|
||||
addLogEntry("DRY-RUN: Not updating hash files as --dry-run has been used");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3143,9 +3143,9 @@ void outputLongHelp(Option[] opt) {
|
|||
|
||||
Usage:
|
||||
onedrive [options] --sync
|
||||
Do a one time synchronization
|
||||
Do a one-time synchronisation with Microsoft OneDrive
|
||||
onedrive [options] --monitor
|
||||
Monitor filesystem and sync regularly
|
||||
Monitor filesystem and synchronise regularly with Microsoft OneDrive
|
||||
onedrive [options] --display-config
|
||||
Display the currently used configuration
|
||||
onedrive [options] --display-sync-status
|
||||
|
|
|
|||
|
|
@ -464,7 +464,7 @@ int main(string[] cliArgs) {
|
|||
safeRemove(appConfig.intuneAccountDetailsFilePath);
|
||||
} else {
|
||||
// --dry-run scenario ... technically we should not be making any local file changes .......
|
||||
addLogEntry("DRY RUN: Not removing the saved authentication status");
|
||||
addLogEntry("DRY-RUN: Not removing the saved authentication status");
|
||||
}
|
||||
// Exit
|
||||
return EXIT_SUCCESS;
|
||||
|
|
@ -481,7 +481,7 @@ int main(string[] cliArgs) {
|
|||
safeRemove(appConfig.intuneAccountDetailsFilePath);
|
||||
} else {
|
||||
// --dry-run scenario ... technically we should not be making any local file changes .......
|
||||
addLogEntry("DRY RUN: Not removing the saved authentication status");
|
||||
addLogEntry("DRY-RUN: Not removing the saved authentication status");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1722,7 +1722,7 @@ void processResyncDatabaseRemoval(string databaseFilePathToRemove) {
|
|||
safeRemove(databaseFilePathToRemove);
|
||||
} else {
|
||||
// --dry-run scenario ... technically we should not be making any local file changes .......
|
||||
addLogEntry("DRY RUN: Not removing the saved application sync status");
|
||||
addLogEntry("DRY-RUN: Not removing the saved application sync status");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
72
src/sync.d
72
src/sync.d
|
|
@ -3453,7 +3453,8 @@ class SyncEngine {
|
|||
// Track this as a faked id item
|
||||
idsFaked ~= [changedOneDriveItem.driveId, changedOneDriveItem.id];
|
||||
// We also need to track that we did not rename this path
|
||||
pathsRenamed ~= [existingItemPath];
|
||||
// When we are checking entries in this array, paths need to have './' added
|
||||
pathsRenamed ~= [ensureStartsWithDotSlash(buildNormalizedPath(existingItemPath))];
|
||||
}
|
||||
} catch (FileException e) {
|
||||
// display the error message
|
||||
|
|
@ -5296,13 +5297,26 @@ class SyncEngine {
|
|||
// We are in a --dry-run situation, file appears to have been deleted locally - this file may never have existed locally as we never downloaded it due to --dry-run
|
||||
// Did we 'fake create it' as part of --dry-run ?
|
||||
bool idsFakedMatch = false;
|
||||
|
||||
// Check the file id - was this faked
|
||||
foreach (i; idsFaked) {
|
||||
if (i[1] == dbItem.id) {
|
||||
if (debugLogging) {addLogEntry("Matched faked file which is 'supposed' to exist but not created due to --dry-run use", ["debug"]);}
|
||||
if (debugLogging) {addLogEntry("Matched faked file which is 'supposed' to exist locally but not created|renamed due to --dry-run use", ["debug"]);}
|
||||
if (verboseLogging) {addLogEntry("The file has not changed", ["verbose"]);}
|
||||
idsFakedMatch = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the parent folder was faked being changed in any way .. so we need to check the parent id
|
||||
foreach (i; idsFaked) {
|
||||
if (i[1] == dbItem.parentId) {
|
||||
if (debugLogging) {addLogEntry("Matched faked parental directory which is 'supposed' to exist locally but not created|renamed due to --dry-run use", ["debug"]);}
|
||||
if (verboseLogging) {addLogEntry("The file has not changed", ["verbose"]);}
|
||||
idsFakedMatch = true;
|
||||
}
|
||||
}
|
||||
|
||||
// file id or parent id of the file did not match anything we faked changing due to --dry-run
|
||||
if (!idsFakedMatch) {
|
||||
// dbItem.id did not match a 'faked' download new file creation - so this in-sync object was actually deleted locally, but we are in a --dry-run situation
|
||||
if (verboseLogging) {addLogEntry("The file has been deleted locally", ["verbose"]);}
|
||||
|
|
@ -5384,7 +5398,7 @@ class SyncEngine {
|
|||
bool idsFakedMatch = false;
|
||||
foreach (i; idsFaked) {
|
||||
if (i[1] == dbItem.id) {
|
||||
if (debugLogging) {addLogEntry("Matched faked dir which is 'supposed' to exist but not created due to --dry-run use", ["debug"]);}
|
||||
if (debugLogging) {addLogEntry("Matched faked directory which is 'supposed' to exist locally but not created|renamed due to --dry-run use", ["debug"]);}
|
||||
if (verboseLogging) {addLogEntry("The directory has not changed", ["verbose"]);}
|
||||
idsFakedMatch = true;
|
||||
}
|
||||
|
|
@ -6129,8 +6143,18 @@ class SyncEngine {
|
|||
|
||||
// So that this path is in the DB, we need to add onedriveJSONItem to the DB so that this record can be used to build paths if required
|
||||
if (parentInDatabase) {
|
||||
// Save this JSON now
|
||||
saveItem(onedriveJSONItem);
|
||||
// Parent is in DB .. is this a 'new' object or an 'existing' object?
|
||||
// Issue #3501 - If an online name name is done, the item needs to be 'renamed' via applyPotentiallyChangedItem() later
|
||||
// Only save to the database at this point, if this JSON 'id' is not already in the database to allow applyPotentiallyChangedItem() to operate as expected
|
||||
Item tempDBItem;
|
||||
itemDB.selectById(onedriveJSONItem["parentReference"]["driveId"].str, onedriveJSONItem["id"].str, tempDBItem);
|
||||
|
||||
// Was a valid DB response returned
|
||||
if (tempDBItem.driveId.empty) {
|
||||
// No .. so this is a new item
|
||||
// Save this JSON now
|
||||
saveItem(onedriveJSONItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7369,11 +7393,26 @@ class SyncEngine {
|
|||
// We can never add or create online the OneDrive 'root'
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Only add unique paths
|
||||
if (!pathsToCreateOnline.canFind(pathToAdd)) {
|
||||
// Add this unique path to the created online
|
||||
pathsToCreateOnline ~= pathToAdd;
|
||||
|
||||
// are we in a --dry-run scenario?
|
||||
if (!dryRun) {
|
||||
// Add this to the list to create online
|
||||
pathsToCreateOnline ~= pathToAdd;
|
||||
} else {
|
||||
// We are in a --dry-run scenario .. this might have been a directory we 'faked' doing something with.
|
||||
// pathsRenamed contains all the paths that were 'renamed'
|
||||
if (pathsRenamed.canFind(ensureStartsWithDotSlash(buildNormalizedPath(pathToAdd)))) {
|
||||
// Path was renamed .. but faked due to --dry-run
|
||||
if (debugLogging) {addLogEntry("DRY-RUN: Skipping creating this directory online as this was a faked local change", ["debug"]);}
|
||||
} else {
|
||||
// Add this to the list to create online
|
||||
pathsToCreateOnline ~= pathToAdd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -7778,12 +7817,27 @@ class SyncEngine {
|
|||
// Ensure this directory on OneDrive so that we can upload files to it
|
||||
// Add this path to an array so that the directory online can be created before we upload files
|
||||
string parentPath = dirName(path);
|
||||
|
||||
if (debugLogging) {addLogEntry("Adding parental path to create online (file inclusion): " ~ parentPath, ["debug"]);}
|
||||
addPathToCreateOnline(parentPath);
|
||||
|
||||
// Add this path as a file we need to upload
|
||||
if (debugLogging) {addLogEntry("OneDrive Client flagging to upload this file to Microsoft OneDrive: " ~ path, ["debug"]);}
|
||||
newLocalFilesToUploadToOneDrive ~= path;
|
||||
|
||||
if (!dryRun) {
|
||||
// Add to the array
|
||||
newLocalFilesToUploadToOneDrive ~= path;
|
||||
} else {
|
||||
// In a --dry-run scenario, we may have locally fake changed a directory name, thus, this path we are checking needs to checked against 'pathsRenamed'
|
||||
if (pathsRenamed.canFind(ensureStartsWithDotSlash(buildNormalizedPath(parentPath)))) {
|
||||
// Parental path was renamed
|
||||
if (debugLogging) {addLogEntry("DRY-RUN: parentPath found in 'pathsRenamed' ... skipping uploading this file", ["debug"]);}
|
||||
} else {
|
||||
// Add to the array
|
||||
newLocalFilesToUploadToOneDrive ~= path;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// we need to clean up this file
|
||||
addLogEntry("Removing local file as --download-only & --cleanup-local-files configured");
|
||||
|
|
@ -10002,7 +10056,7 @@ class SyncEngine {
|
|||
}
|
||||
} else {
|
||||
// log that this is a dry-run activity
|
||||
addLogEntry("dry run - no delete activity");
|
||||
addLogEntry("DRY-RUN: No delete activity");
|
||||
}
|
||||
} else {
|
||||
// --download-only operation, we are not uploading any delete event to OneDrive
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue