Compare commits
33
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea73ac75ba | ||
|
|
50657752fd | ||
|
|
603efbfe76 | ||
|
|
831c79b11d | ||
|
|
acec3dbf11 | ||
|
|
5f710a2d48 | ||
|
|
f675da9053 | ||
|
|
5788d3fc29 | ||
|
|
c5a371d9e4 | ||
|
|
5e441673e3 | ||
|
|
274eca148c | ||
|
|
28925414b8 | ||
|
|
9563a770a1 | ||
|
|
386ca20792 | ||
|
|
8390ba4ca9 | ||
|
|
4eea0ca8bb | ||
|
|
60d59e2600 | ||
|
|
bf0c7e0a6b | ||
|
|
8a8a77ebc5 | ||
|
|
d211372c9e | ||
|
|
1ebe9a800d | ||
|
|
31f0db544f | ||
|
|
37bcc3df14 | ||
|
|
74401077dc | ||
|
|
d96789e1b8 | ||
|
|
69165c0924 | ||
|
|
c8a2aa310e | ||
|
|
9417732f07 | ||
|
|
9ba253a355 | ||
|
|
a6fba1f0c6 | ||
|
|
80c5850ee8 | ||
|
|
727387ab1e | ||
|
|
8226b6ada2 |
No files matched your search
+12
-22
@@ -25,12 +25,12 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
job_name: ['linux', 'linux_386', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.17', 'go1.18']
|
||||
job_name: ['linux', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.16', 'go1.17']
|
||||
|
||||
include:
|
||||
- job_name: linux
|
||||
os: ubuntu-latest
|
||||
go: '1.19.x'
|
||||
go: '1.18.x'
|
||||
gotags: cmount
|
||||
build_flags: '-include "^linux/"'
|
||||
check: true
|
||||
@@ -39,16 +39,9 @@ jobs:
|
||||
librclonetest: true
|
||||
deploy: true
|
||||
|
||||
- job_name: linux_386
|
||||
os: ubuntu-latest
|
||||
go: '1.19.x'
|
||||
goarch: 386
|
||||
gotags: cmount
|
||||
quicktest: true
|
||||
|
||||
- job_name: mac_amd64
|
||||
os: macos-11
|
||||
go: '1.19.x'
|
||||
go: '1.18.x'
|
||||
gotags: 'cmount'
|
||||
build_flags: '-include "^darwin/amd64" -cgo'
|
||||
quicktest: true
|
||||
@@ -57,14 +50,14 @@ jobs:
|
||||
|
||||
- job_name: mac_arm64
|
||||
os: macos-11
|
||||
go: '1.19.x'
|
||||
go: '1.18.x'
|
||||
gotags: 'cmount'
|
||||
build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib'
|
||||
deploy: true
|
||||
|
||||
- job_name: windows
|
||||
os: windows-latest
|
||||
go: '1.19.x'
|
||||
go: '1.18.x'
|
||||
gotags: cmount
|
||||
cgo: '0'
|
||||
build_flags: '-include "^windows/"'
|
||||
@@ -74,20 +67,20 @@ jobs:
|
||||
|
||||
- job_name: other_os
|
||||
os: ubuntu-latest
|
||||
go: '1.19.x'
|
||||
go: '1.18.x'
|
||||
build_flags: '-exclude "^(windows/|darwin/|linux/)"'
|
||||
compile_all: true
|
||||
deploy: true
|
||||
|
||||
- job_name: go1.17
|
||||
- job_name: go1.16
|
||||
os: ubuntu-latest
|
||||
go: '1.17.x'
|
||||
go: '1.16.x'
|
||||
quicktest: true
|
||||
racequicktest: true
|
||||
|
||||
- job_name: go1.18
|
||||
- job_name: go1.17
|
||||
os: ubuntu-latest
|
||||
go: '1.18.x'
|
||||
go: '1.17.x'
|
||||
quicktest: true
|
||||
racequicktest: true
|
||||
|
||||
@@ -227,12 +220,9 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# FIXME temporary until golangci-lint supports go1.19
|
||||
go-version: 1.18.x
|
||||
|
||||
- name: Code quality test
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
with:
|
||||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
|
||||
version: latest
|
||||
@@ -253,7 +243,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.19.x
|
||||
go-version: 1.18.x
|
||||
|
||||
- name: Go module cache
|
||||
uses: actions/cache@v2
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ linters:
|
||||
enable:
|
||||
- deadcode
|
||||
- errcheck
|
||||
- goimports
|
||||
- revive
|
||||
#- goimports
|
||||
#- revive
|
||||
- ineffassign
|
||||
- structcheck
|
||||
- varcheck
|
||||
|
||||
Generated
+105
-19
@@ -19,7 +19,7 @@
|
||||
<header id="title-block-header">
|
||||
<h1 class="title">rclone(1) User Manual</h1>
|
||||
<p class="author">Nick Craig-Wood</p>
|
||||
<p class="date">Jul 09, 2022</p>
|
||||
<p class="date">Sep 15, 2022</p>
|
||||
</header>
|
||||
<h1 id="rclone-syncs-your-files-to-cloud-storage">Rclone syncs your files to cloud storage</h1>
|
||||
<p><img width="50%" src="https://rclone.org/img/logo_on_light__horizontal_color.svg" alt="rclone logo" style="float:right; padding: 5px;" ></p>
|
||||
@@ -300,7 +300,7 @@ go build</code></pre>
|
||||
<p>Run the <a href="https://rclone.org/commands/rclone_config_paths/">config paths</a> command to see the locations that rclone will use.</p>
|
||||
<p>To override them set the corresponding options (as command-line arguments, or as <a href="https://rclone.org/docs/#environment-variables">environment variables</a>): - <a href="https://rclone.org/docs/#config-config-file">--config</a> - <a href="https://rclone.org/docs/#cache-dir-dir">--cache-dir</a> - <a href="https://rclone.org/docs/#temp-dir-dir">--temp-dir</a></p>
|
||||
<h2 id="autostart">Autostart</h2>
|
||||
<p>After installing and configuring rclone, as described above, you are ready to use rclone as an interactive command line utility. If your goal is to perform <em>periodic</em> operations, such as a regular <a href="https://rclone.org/commands/rclone_sync/">sync</a>, you will probably want to configure your rclone command in your operating system's scheduler. If you need to expose <em>service</em>-like features, such as <a href="https://rclone.org/rc/">remote control</a>, <a href="https://rclone.org/gui/">GUI</a>, <a href="https://rclone.org/commands/rclone_serve/">serve</a> or <a href="https://rclone.org/commands/rclone_move/">mount</a>, you will often want an rclone command always running in the background, and configuring it to run in a service infrastructure may be a better option. Below are some alternatives on how to achieve this on different operating systems.</p>
|
||||
<p>After installing and configuring rclone, as described above, you are ready to use rclone as an interactive command line utility. If your goal is to perform <em>periodic</em> operations, such as a regular <a href="https://rclone.org/commands/rclone_sync/">sync</a>, you will probably want to configure your rclone command in your operating system's scheduler. If you need to expose <em>service</em>-like features, such as <a href="https://rclone.org/rc/">remote control</a>, <a href="https://rclone.org/gui/">GUI</a>, <a href="https://rclone.org/commands/rclone_serve/">serve</a> or <a href="https://rclone.org/commands/rclone_mount/">mount</a>, you will often want an rclone command always running in the background, and configuring it to run in a service infrastructure may be a better option. Below are some alternatives on how to achieve this on different operating systems.</p>
|
||||
<p>NOTE: Before setting up autorun it is highly recommended that you have tested your command manually from a Command Prompt first.</p>
|
||||
<h3 id="autostart-on-windows">Autostart on Windows</h3>
|
||||
<p>The most relevant alternatives for autostart on Windows are: - Run at user log on using the Startup folder - Run at user log on, at system startup or at schedule using Task Scheduler - Run at system startup using Windows service</p>
|
||||
@@ -309,7 +309,7 @@ go build</code></pre>
|
||||
<p>Example command to run a sync in background:</p>
|
||||
<pre><code>c:\rclone\rclone.exe sync c:\files remote:/files --no-console --log-file c:\rclone\logs\sync_files.txt</code></pre>
|
||||
<h4 id="user-account">User account</h4>
|
||||
<p>As mentioned in the <a href="https://rclone.org/commands/rclone_move/">mount</a> documentation, mounted drives created as Administrator are not visible to other accounts, not even the account that was elevated as Administrator. By running the mount command as the built-in <code>SYSTEM</code> user account, it will create drives accessible for everyone on the system. Both scheduled task and Windows service can be used to achieve this.</p>
|
||||
<p>As mentioned in the <a href="https://rclone.org/commands/rclone_mount/">mount</a> documentation, mounted drives created as Administrator are not visible to other accounts, not even the account that was elevated as Administrator. By running the mount command as the built-in <code>SYSTEM</code> user account, it will create drives accessible for everyone on the system. Both scheduled task and Windows service can be used to achieve this.</p>
|
||||
<p>NOTE: Remember that when rclone runs as the <code>SYSTEM</code> user, the user profile that it sees will not be yours. This means that if you normally run rclone with configuration file in the default location, to be able to use the same configuration when running as the system user you must explicitely tell rclone where to find it with the <a href="https://rclone.org/docs/#config-config-file"><code>--config</code></a> option, or else it will look in the system users profile path (<code>C:\Windows\System32\config\systemprofile</code>). To test your command manually from a Command Prompt, you can run it with the <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/psexec">PsExec</a> utility from Microsoft's Sysinternals suite, which takes option <code>-s</code> to execute commands as the <code>SYSTEM</code> user.</p>
|
||||
<h4 id="start-from-startup-folder">Start from Startup folder</h4>
|
||||
<p>To quickly execute an rclone command you can simply create a standard Windows Explorer shortcut for the complete rclone command you want to run. If you store this shortcut in the special "Startup" start-menu folder, Windows will automatically run it at login. To open this folder in Windows Explorer, enter path <code>%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup</code>, or <code>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp</code> if you want the command to start for <em>every</em> user that logs in.</p>
|
||||
@@ -469,6 +469,7 @@ destpath/sourcepath/two.txt</code></pre>
|
||||
<p>Note that files in the destination won't be deleted if there were any errors at any point. Duplicate objects (files with the same name, on those providers that support it) are also not yet handled.</p>
|
||||
<p>It is always the contents of the directory that is synced, not the directory itself. So when source:path is a directory, it's the contents of source:path that are copied, not the directory name and contents. See extended explanation in the <a href="https://rclone.org/commands/rclone_copy/">copy</a> command if unsure.</p>
|
||||
<p>If dest:path doesn't exist, it is created and the source:path contents go there.</p>
|
||||
<p>It is not possible to sync overlapping remotes. However, you may exclude the destination from the sync with a filter rule or by putting an exclude-if-present file inside the destination directory and sync to a destination that is inside the source directory.</p>
|
||||
<p><strong>Note</strong>: Use the <code>-P</code>/<code>--progress</code> flag to view real-time transfer statistics</p>
|
||||
<p><strong>Note</strong>: Use the <code>rclone dedupe</code> command to deal with "Duplicate object/directory found in source/destination - ignoring" errors. See <a href="https://forum.rclone.org/t/sync-not-clearing-duplicates/14372">this forum post</a> for more info.</p>
|
||||
<pre><code>rclone sync source:path dest:path [flags]</code></pre>
|
||||
@@ -4236,7 +4237,7 @@ rclone sync -i /path/to/files remote:current-backup</code></pre>
|
||||
<h3 id="backup-dirdir">--backup-dir=DIR</h3>
|
||||
<p>When using <code>sync</code>, <code>copy</code> or <code>move</code> any files which would have been overwritten or deleted are moved in their original hierarchy into this directory.</p>
|
||||
<p>If <code>--suffix</code> is set, then the moved files will have the suffix added to them. If there is a file with the same path (after the suffix has been added) in DIR, then it will be overwritten.</p>
|
||||
<p>The remote in use must support server-side move or copy and you must use the same remote as the destination of the sync. The backup directory must not overlap the destination directory.</p>
|
||||
<p>The remote in use must support server-side move or copy and you must use the same remote as the destination of the sync. The backup directory must not overlap the destination directory without it being excluded by a filter rule.</p>
|
||||
<p>For example</p>
|
||||
<pre><code>rclone sync -i /path/to/local remote:current --backup-dir remote:old</code></pre>
|
||||
<p>will sync <code>/path/to/local</code> to <code>remote:current</code>, but for any files which would have been updated or deleted will be stored in <code>remote:old</code>.</p>
|
||||
@@ -8378,7 +8379,7 @@ Showing nodes accounting for 1537.03kB, 100% of 1537.03kB total
|
||||
--use-json-log Use json log format
|
||||
--use-mmap Use mmap allocator (see docs)
|
||||
--use-server-modtime Use server modified time instead of object metadata
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.59.0")
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.59.2")
|
||||
-v, --verbose count Print lots more stuff (repeat for more)</code></pre>
|
||||
<h2 id="backend-flags">Backend Flags</h2>
|
||||
<p>These flags are available for every command. They control the backends and may be set in the config file.</p>
|
||||
@@ -17156,7 +17157,7 @@ remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
|
||||
|
||||
[AllDrives]
|
||||
type = combine
|
||||
remote = "My Drive=My Drive:" "Test Drive=Test Drive:"</code></pre>
|
||||
upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"</code></pre>
|
||||
<p>If you then add that config to your config file (find it with <code>rclone config file</code>) then you can access all the shared drives in one place with the <code>AllDrives:</code> remote.</p>
|
||||
<p>See <a href="https://rclone.org/drive/#drives">the Google Drive docs</a> for full info.</p>
|
||||
<h3 id="standard-options-11">Standard options</h3>
|
||||
@@ -19657,7 +19658,7 @@ remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
|
||||
|
||||
[AllDrives]
|
||||
type = combine
|
||||
remote = "My Drive=My Drive:" "Test Drive=Test Drive:"</code></pre>
|
||||
upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"</code></pre>
|
||||
<p>Adding this to the rclone config file will cause those team drives to be accessible with the aliases shown. Any illegal charactes will be substituted with "_" and duplicate names will have numbers suffixed. It will also add a remote called AllDrives which shows all the shared drives combined into one directory tree.</p>
|
||||
<h3 id="untrash">untrash</h3>
|
||||
<p>Untrash files and directories</p>
|
||||
@@ -20952,8 +20953,8 @@ y/e/d> y</code></pre>
|
||||
<p>The Internet Archive backend utilizes Items on <a href="https://archive.org/">archive.org</a></p>
|
||||
<p>Refer to <a href="https://archive.org/services/docs/api/ias3.html">IAS3 API documentation</a> for the API this backend uses.</p>
|
||||
<p>Paths are specified as <code>remote:bucket</code> (or <code>remote:</code> for the <code>lsd</code> command.) You may put subdirectories in too, e.g. <code>remote:item/path/to/dir</code>.</p>
|
||||
<p>Once you have made a remote (see the provider specific section above) you can use it like this:</p>
|
||||
<p>Unlike S3, listing up all items uploaded by you isn't supported.</p>
|
||||
<p>Once you have made a remote, you can use it like this:</p>
|
||||
<p>Make a new item</p>
|
||||
<pre><code>rclone mkdir remote:item</code></pre>
|
||||
<p>List the contents of a item</p>
|
||||
@@ -20965,7 +20966,7 @@ y/e/d> y</code></pre>
|
||||
<p>You can optionally wait for the server's processing to finish, by setting non-zero value to <code>wait_archive</code> key. By making it wait, rclone can do normal file comparison. Make sure to set a large enough value (e.g. <code>30m0s</code> for smaller files) as it can take a long time depending on server's queue.</p>
|
||||
<h2 id="about-metadata">About metadata</h2>
|
||||
<p>This backend supports setting, updating and reading metadata of each file. The metadata will appear as file metadata on Internet Archive. However, some fields are reserved by both Internet Archive and rclone.</p>
|
||||
<p>The following are reserved by Internet Archive: - <code>name</code> - <code>source</code> - <code>size</code> - <code>md5</code> - <code>crc32</code> - <code>sha1</code> - <code>format</code> - <code>old_version</code> - <code>viruscheck</code></p>
|
||||
<p>The following are reserved by Internet Archive: - <code>name</code> - <code>source</code> - <code>size</code> - <code>md5</code> - <code>crc32</code> - <code>sha1</code> - <code>format</code> - <code>old_version</code> - <code>viruscheck</code> - <code>summation</code></p>
|
||||
<p>Trying to set values to these keys is ignored with a warning. Only setting <code>mtime</code> is an exception. Doing so make it the identical behavior as setting ModTime.</p>
|
||||
<p>rclone reserves all the keys starting with <code>rclone-</code>. Setting value for these keys will give you warnings, but values are set according to request.</p>
|
||||
<p>If there are multiple values for a key, only the first one is returned. This is a limitation of rclone, that supports one value per one key. It can be triggered when you did a server-side copy.</p>
|
||||
@@ -21138,42 +21139,42 @@ y/e/d> y</code></pre>
|
||||
<td>CRC32 calculated by Internet Archive</td>
|
||||
<td>string</td>
|
||||
<td>01234567</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>format</td>
|
||||
<td>Name of format identified by Internet Archive</td>
|
||||
<td>string</td>
|
||||
<td>Comma-Separated Values</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>md5</td>
|
||||
<td>MD5 hash calculated by Internet Archive</td>
|
||||
<td>string</td>
|
||||
<td>01234567012345670123456701234567</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>mtime</td>
|
||||
<td>Time of last modification, managed by Rclone</td>
|
||||
<td>RFC 3339</td>
|
||||
<td>2006-01-02T15:04:05.999999999Z</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>name</td>
|
||||
<td>Full file path, without the bucket part</td>
|
||||
<td>filename</td>
|
||||
<td>backend/internetarchive/internetarchive.go</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>old_version</td>
|
||||
<td>Whether the file was replaced and moved by keep-old-version flag</td>
|
||||
<td>boolean</td>
|
||||
<td>true</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>rclone-ia-mtime</td>
|
||||
@@ -21201,28 +21202,35 @@ y/e/d> y</code></pre>
|
||||
<td>SHA1 hash calculated by Internet Archive</td>
|
||||
<td>string</td>
|
||||
<td>0123456701234567012345670123456701234567</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>size</td>
|
||||
<td>File size in bytes</td>
|
||||
<td>decimal number</td>
|
||||
<td>123456</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>source</td>
|
||||
<td>The source of the file</td>
|
||||
<td>string</td>
|
||||
<td>original</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>summation</td>
|
||||
<td>Check https://forum.rclone.org/t/31922 for how it is used</td>
|
||||
<td>string</td>
|
||||
<td>md5</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>viruscheck</td>
|
||||
<td>The last time viruscheck process was run for the file (?)</td>
|
||||
<td>unixtime</td>
|
||||
<td>1654191352</td>
|
||||
<td>N</td>
|
||||
<td><strong>Y</strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -27757,6 +27765,84 @@ $ tree /tmp/b
|
||||
<li>"error": return an error based on option value</li>
|
||||
</ul>
|
||||
<h1 id="changelog">Changelog</h1>
|
||||
<h2 id="v1.59.2---2022-09-15">v1.59.2 - 2022-09-15</h2>
|
||||
<p><a href="https://github.com/rclone/rclone/compare/v1.59.1...v1.59.2">See commits</a></p>
|
||||
<ul>
|
||||
<li>Bug Fixes
|
||||
<ul>
|
||||
<li>config: Move locking to fix fatal error: concurrent map read and map write (Nick Craig-Wood)</li>
|
||||
</ul></li>
|
||||
<li>Local
|
||||
<ul>
|
||||
<li>Disable xattr support if the filesystems indicates it is not supported (Nick Craig-Wood)</li>
|
||||
</ul></li>
|
||||
<li>Azure Blob
|
||||
<ul>
|
||||
<li>Fix chunksize calculations producing too many parts (Nick Craig-Wood)</li>
|
||||
</ul></li>
|
||||
<li>B2
|
||||
<ul>
|
||||
<li>Fix chunksize calculations producing too many parts (Nick Craig-Wood)</li>
|
||||
</ul></li>
|
||||
<li>S3
|
||||
<ul>
|
||||
<li>Fix chunksize calculations producing too many parts (Nick Craig-Wood)</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="v1.59.1---2022-08-08">v1.59.1 - 2022-08-08</h2>
|
||||
<p><a href="https://github.com/rclone/rclone/compare/v1.59.0...v1.59.1">See commits</a></p>
|
||||
<ul>
|
||||
<li>Bug Fixes
|
||||
<ul>
|
||||
<li>accounting: Fix panic in core/stats-reset with unknown group (Nick Craig-Wood)</li>
|
||||
<li>build: Fix android build after GitHub actions change (Nick Craig-Wood)</li>
|
||||
<li>dlna: Fix SOAP action header parsing (Joram Schrijver)</li>
|
||||
<li>docs: Fix links to mount command from install docs (albertony)</li>
|
||||
<li>dropox: Fix ChangeNotify was unable to decrypt errors (Nick Craig-Wood)</li>
|
||||
<li>fs: Fix parsing of times and durations of the form "YYYY-MM-DD HH:MM:SS" (Nick Craig-Wood)</li>
|
||||
<li>serve sftp: Fix checksum detection (Nick Craig-Wood)</li>
|
||||
<li>sync: Add accidentally missed filter-sensitivity to --backup-dir option (Nick Naumann)</li>
|
||||
</ul></li>
|
||||
<li>Combine
|
||||
<ul>
|
||||
<li>Fix docs showing <code>remote=</code> instead of <code>upstreams=</code> (Nick Craig-Wood)</li>
|
||||
<li>Throw error if duplicate directory name is specified (Nick Craig-Wood)</li>
|
||||
<li>Fix errors with backends shutting down while in use (Nick Craig-Wood)</li>
|
||||
</ul></li>
|
||||
<li>Dropbox
|
||||
<ul>
|
||||
<li>Fix hang on quit with --dropbox-batch-mode off (Nick Craig-Wood)</li>
|
||||
<li>Fix infinite loop on uploading a corrupted file (Nick Craig-Wood)</li>
|
||||
</ul></li>
|
||||
<li>Internetarchive
|
||||
<ul>
|
||||
<li>Ignore checksums for files using the different method (Lesmiscore)</li>
|
||||
<li>Handle hash symbol in the middle of filename (Lesmiscore)</li>
|
||||
</ul></li>
|
||||
<li>Jottacloud
|
||||
<ul>
|
||||
<li>Fix working with whitelabel Elgiganten Cloud</li>
|
||||
<li>Do not store username in config when using standard auth (albertony)</li>
|
||||
</ul></li>
|
||||
<li>Mega
|
||||
<ul>
|
||||
<li>Fix nil pointer exception when bad node received (Nick Craig-Wood)</li>
|
||||
</ul></li>
|
||||
<li>S3
|
||||
<ul>
|
||||
<li>Fix --s3-no-head panic: reflect: Elem of invalid type s3.PutObjectInput (Nick Craig-Wood)</li>
|
||||
</ul></li>
|
||||
<li>SFTP
|
||||
<ul>
|
||||
<li>Fix issue with WS_FTP by working around failing RealPath (albertony)</li>
|
||||
</ul></li>
|
||||
<li>Union
|
||||
<ul>
|
||||
<li>Fix duplicated files when using directories with leading / (Nick Craig-Wood)</li>
|
||||
<li>Fix multiple files being uploaded when roots don't exist (Nick Craig-Wood)</li>
|
||||
<li>Fix panic due to misalignment of struct field in 32 bit architectures (r-ricci)</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="v1.59.0---2022-07-09">v1.59.0 - 2022-07-09</h2>
|
||||
<p><a href="https://github.com/rclone/rclone/compare/v1.58.0...v1.59.0">See commits</a></p>
|
||||
<ul>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
% rclone(1) User Manual
|
||||
% Nick Craig-Wood
|
||||
% Jul 09, 2022
|
||||
% Sep 15, 2022
|
||||
|
||||
# Rclone syncs your files to cloud storage
|
||||
|
||||
@@ -506,7 +506,7 @@ such as a regular [sync](https://rclone.org/commands/rclone_sync/), you will pro
|
||||
to configure your rclone command in your operating system's scheduler. If you need to
|
||||
expose *service*-like features, such as [remote control](https://rclone.org/rc/),
|
||||
[GUI](https://rclone.org/gui/), [serve](https://rclone.org/commands/rclone_serve/)
|
||||
or [mount](https://rclone.org/commands/rclone_move/), you will often want an rclone
|
||||
or [mount](https://rclone.org/commands/rclone_mount/), you will often want an rclone
|
||||
command always running in the background, and configuring it to run in a service infrastructure
|
||||
may be a better option. Below are some alternatives on how to achieve this on
|
||||
different operating systems.
|
||||
@@ -539,7 +539,7 @@ c:\rclone\rclone.exe sync c:\files remote:/files --no-console --log-file c:\rclo
|
||||
|
||||
#### User account
|
||||
|
||||
As mentioned in the [mount](https://rclone.org/commands/rclone_move/) documentation,
|
||||
As mentioned in the [mount](https://rclone.org/commands/rclone_mount/) documentation,
|
||||
mounted drives created as Administrator are not visible to other accounts, not even the
|
||||
account that was elevated as Administrator. By running the mount command as the
|
||||
built-in `SYSTEM` user account, it will create drives accessible for everyone on
|
||||
@@ -897,6 +897,11 @@ extended explanation in the [copy](https://rclone.org/commands/rclone_copy/) com
|
||||
If dest:path doesn't exist, it is created and the source:path contents
|
||||
go there.
|
||||
|
||||
It is not possible to sync overlapping remotes. However, you may exclude
|
||||
the destination from the sync with a filter rule or by putting an
|
||||
exclude-if-present file inside the destination directory and sync to a
|
||||
destination that is inside the source directory.
|
||||
|
||||
**Note**: Use the `-P`/`--progress` flag to view real-time transfer statistics
|
||||
|
||||
**Note**: Use the `rclone dedupe` command to deal with "Duplicate object/directory found in source/destination - ignoring" errors.
|
||||
@@ -8735,7 +8740,8 @@ been added) in DIR, then it will be overwritten.
|
||||
|
||||
The remote in use must support server-side move or copy and you must
|
||||
use the same remote as the destination of the sync. The backup
|
||||
directory must not overlap the destination directory.
|
||||
directory must not overlap the destination directory without it being
|
||||
excluded by a filter rule.
|
||||
|
||||
For example
|
||||
|
||||
@@ -14336,7 +14342,7 @@ These flags are available for every command.
|
||||
--use-json-log Use json log format
|
||||
--use-mmap Use mmap allocator (see docs)
|
||||
--use-server-modtime Use server modified time instead of object metadata
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.59.0")
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.59.2")
|
||||
-v, --verbose count Print lots more stuff (repeat for more)
|
||||
```
|
||||
|
||||
@@ -25136,7 +25142,7 @@ This would produce something like this:
|
||||
|
||||
[AllDrives]
|
||||
type = combine
|
||||
remote = "My Drive=My Drive:" "Test Drive=Test Drive:"
|
||||
upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
|
||||
|
||||
If you then add that config to your config file (find it with `rclone
|
||||
config file`) then you can access all the shared drives in one place
|
||||
@@ -28343,7 +28349,7 @@ drives found and a combined drive.
|
||||
|
||||
[AllDrives]
|
||||
type = combine
|
||||
remote = "My Drive=My Drive:" "Test Drive=Test Drive:"
|
||||
upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
|
||||
|
||||
Adding this to the rclone config file will cause those team drives to
|
||||
be accessible with the aliases shown. Any illegal charactes will be
|
||||
@@ -30495,11 +30501,10 @@ Refer to [IAS3 API documentation](https://archive.org/services/docs/api/ias3.htm
|
||||
Paths are specified as `remote:bucket` (or `remote:` for the `lsd`
|
||||
command.) You may put subdirectories in too, e.g. `remote:item/path/to/dir`.
|
||||
|
||||
Once you have made a remote (see the provider specific section above)
|
||||
you can use it like this:
|
||||
|
||||
Unlike S3, listing up all items uploaded by you isn't supported.
|
||||
|
||||
Once you have made a remote, you can use it like this:
|
||||
|
||||
Make a new item
|
||||
|
||||
rclone mkdir remote:item
|
||||
@@ -30536,6 +30541,7 @@ The following are reserved by Internet Archive:
|
||||
- `format`
|
||||
- `old_version`
|
||||
- `viruscheck`
|
||||
- `summation`
|
||||
|
||||
Trying to set values to these keys is ignored with a warning.
|
||||
Only setting `mtime` is an exception. Doing so make it the identical behavior as setting ModTime.
|
||||
@@ -30741,19 +30747,20 @@ Here are the possible system metadata items for the internetarchive backend.
|
||||
|
||||
| Name | Help | Type | Example | Read Only |
|
||||
|------|------|------|---------|-----------|
|
||||
| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | N |
|
||||
| format | Name of format identified by Internet Archive | string | Comma-Separated Values | N |
|
||||
| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | N |
|
||||
| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N |
|
||||
| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | N |
|
||||
| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | N |
|
||||
| crc32 | CRC32 calculated by Internet Archive | string | 01234567 | **Y** |
|
||||
| format | Name of format identified by Internet Archive | string | Comma-Separated Values | **Y** |
|
||||
| md5 | MD5 hash calculated by Internet Archive | string | 01234567012345670123456701234567 | **Y** |
|
||||
| mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | **Y** |
|
||||
| name | Full file path, without the bucket part | filename | backend/internetarchive/internetarchive.go | **Y** |
|
||||
| old_version | Whether the file was replaced and moved by keep-old-version flag | boolean | true | **Y** |
|
||||
| rclone-ia-mtime | Time of last modification, managed by Internet Archive | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N |
|
||||
| rclone-mtime | Time of last modification, managed by Rclone | RFC 3339 | 2006-01-02T15:04:05.999999999Z | N |
|
||||
| rclone-update-track | Random value used by Rclone for tracking changes inside Internet Archive | string | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | N |
|
||||
| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | N |
|
||||
| size | File size in bytes | decimal number | 123456 | N |
|
||||
| source | The source of the file | string | original | N |
|
||||
| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | N |
|
||||
| sha1 | SHA1 hash calculated by Internet Archive | string | 0123456701234567012345670123456701234567 | **Y** |
|
||||
| size | File size in bytes | decimal number | 123456 | **Y** |
|
||||
| source | The source of the file | string | original | **Y** |
|
||||
| summation | Check https://forum.rclone.org/t/31922 for how it is used | string | md5 | **Y** |
|
||||
| viruscheck | The last time viruscheck process was run for the file (?) | unixtime | 1654191352 | **Y** |
|
||||
|
||||
See the [metadata](https://rclone.org/docs/#metadata) docs for more info.
|
||||
|
||||
@@ -39413,6 +39420,58 @@ Options:
|
||||
|
||||
# Changelog
|
||||
|
||||
## v1.59.2 - 2022-09-15
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.59.1...v1.59.2)
|
||||
|
||||
* Bug Fixes
|
||||
* config: Move locking to fix fatal error: concurrent map read and map write (Nick Craig-Wood)
|
||||
* Local
|
||||
* Disable xattr support if the filesystems indicates it is not supported (Nick Craig-Wood)
|
||||
* Azure Blob
|
||||
* Fix chunksize calculations producing too many parts (Nick Craig-Wood)
|
||||
* B2
|
||||
* Fix chunksize calculations producing too many parts (Nick Craig-Wood)
|
||||
* S3
|
||||
* Fix chunksize calculations producing too many parts (Nick Craig-Wood)
|
||||
|
||||
## v1.59.1 - 2022-08-08
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.59.0...v1.59.1)
|
||||
|
||||
* Bug Fixes
|
||||
* accounting: Fix panic in core/stats-reset with unknown group (Nick Craig-Wood)
|
||||
* build: Fix android build after GitHub actions change (Nick Craig-Wood)
|
||||
* dlna: Fix SOAP action header parsing (Joram Schrijver)
|
||||
* docs: Fix links to mount command from install docs (albertony)
|
||||
* dropox: Fix ChangeNotify was unable to decrypt errors (Nick Craig-Wood)
|
||||
* fs: Fix parsing of times and durations of the form "YYYY-MM-DD HH:MM:SS" (Nick Craig-Wood)
|
||||
* serve sftp: Fix checksum detection (Nick Craig-Wood)
|
||||
* sync: Add accidentally missed filter-sensitivity to --backup-dir option (Nick Naumann)
|
||||
* Combine
|
||||
* Fix docs showing `remote=` instead of `upstreams=` (Nick Craig-Wood)
|
||||
* Throw error if duplicate directory name is specified (Nick Craig-Wood)
|
||||
* Fix errors with backends shutting down while in use (Nick Craig-Wood)
|
||||
* Dropbox
|
||||
* Fix hang on quit with --dropbox-batch-mode off (Nick Craig-Wood)
|
||||
* Fix infinite loop on uploading a corrupted file (Nick Craig-Wood)
|
||||
* Internetarchive
|
||||
* Ignore checksums for files using the different method (Lesmiscore)
|
||||
* Handle hash symbol in the middle of filename (Lesmiscore)
|
||||
* Jottacloud
|
||||
* Fix working with whitelabel Elgiganten Cloud
|
||||
* Do not store username in config when using standard auth (albertony)
|
||||
* Mega
|
||||
* Fix nil pointer exception when bad node received (Nick Craig-Wood)
|
||||
* S3
|
||||
* Fix --s3-no-head panic: reflect: Elem of invalid type s3.PutObjectInput (Nick Craig-Wood)
|
||||
* SFTP
|
||||
* Fix issue with WS_FTP by working around failing RealPath (albertony)
|
||||
* Union
|
||||
* Fix duplicated files when using directories with leading / (Nick Craig-Wood)
|
||||
* Fix multiple files being uploaded when roots don't exist (Nick Craig-Wood)
|
||||
* Fix panic due to misalignment of struct field in 32 bit architectures (r-ricci)
|
||||
|
||||
## v1.59.0 - 2022-07-09
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.58.0...v1.59.0)
|
||||
|
||||
Generated
+121
-56
@@ -1,6 +1,6 @@
|
||||
rclone(1) User Manual
|
||||
Nick Craig-Wood
|
||||
Jul 09, 2022
|
||||
Sep 15, 2022
|
||||
|
||||
Rclone syncs your files to cloud storage
|
||||
|
||||
@@ -857,6 +857,11 @@ extended explanation in the copy command if unsure.
|
||||
If dest:path doesn't exist, it is created and the source:path contents
|
||||
go there.
|
||||
|
||||
It is not possible to sync overlapping remotes. However, you may exclude
|
||||
the destination from the sync with a filter rule or by putting an
|
||||
exclude-if-present file inside the destination directory and sync to a
|
||||
destination that is inside the source directory.
|
||||
|
||||
Note: Use the -P/--progress flag to view real-time transfer statistics
|
||||
|
||||
Note: Use the rclone dedupe command to deal with "Duplicate
|
||||
@@ -8332,7 +8337,8 @@ added) in DIR, then it will be overwritten.
|
||||
|
||||
The remote in use must support server-side move or copy and you must use
|
||||
the same remote as the destination of the sync. The backup directory
|
||||
must not overlap the destination directory.
|
||||
must not overlap the destination directory without it being excluded by
|
||||
a filter rule.
|
||||
|
||||
For example
|
||||
|
||||
@@ -13887,7 +13893,7 @@ These flags are available for every command.
|
||||
--use-json-log Use json log format
|
||||
--use-mmap Use mmap allocator (see docs)
|
||||
--use-server-modtime Use server modified time instead of object metadata
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.59.0")
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.59.2")
|
||||
-v, --verbose count Print lots more stuff (repeat for more)
|
||||
|
||||
Backend Flags
|
||||
@@ -24544,7 +24550,7 @@ This would produce something like this:
|
||||
|
||||
[AllDrives]
|
||||
type = combine
|
||||
remote = "My Drive=My Drive:" "Test Drive=Test Drive:"
|
||||
upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
|
||||
|
||||
If you then add that config to your config file (find it with
|
||||
rclone config file) then you can access all the shared drives in one
|
||||
@@ -27752,7 +27758,7 @@ found and a combined drive.
|
||||
|
||||
[AllDrives]
|
||||
type = combine
|
||||
remote = "My Drive=My Drive:" "Test Drive=Test Drive:"
|
||||
upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"
|
||||
|
||||
Adding this to the rclone config file will cause those team drives to be
|
||||
accessible with the aliases shown. Any illegal charactes will be
|
||||
@@ -29886,11 +29892,10 @@ Refer to IAS3 API documentation for the API this backend uses.
|
||||
Paths are specified as remote:bucket (or remote: for the lsd command.)
|
||||
You may put subdirectories in too, e.g. remote:item/path/to/dir.
|
||||
|
||||
Once you have made a remote (see the provider specific section above)
|
||||
you can use it like this:
|
||||
|
||||
Unlike S3, listing up all items uploaded by you isn't supported.
|
||||
|
||||
Once you have made a remote, you can use it like this:
|
||||
|
||||
Make a new item
|
||||
|
||||
rclone mkdir remote:item
|
||||
@@ -29929,7 +29934,7 @@ file. The metadata will appear as file metadata on Internet Archive.
|
||||
However, some fields are reserved by both Internet Archive and rclone.
|
||||
|
||||
The following are reserved by Internet Archive: - name - source - size -
|
||||
md5 - crc32 - sha1 - format - old_version - viruscheck
|
||||
md5 - crc32 - sha1 - format - old_version - viruscheck - summation
|
||||
|
||||
Trying to set values to these keys is ignored with a warning. Only
|
||||
setting mtime is an exception. Doing so make it the identical behavior
|
||||
@@ -30140,65 +30145,52 @@ including them.
|
||||
Here are the possible system metadata items for the internetarchive
|
||||
backend.
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
Name Help Type Example Read Only
|
||||
--------------------- ------------------ ----------- -------------------------------------------- --------------------
|
||||
crc32 CRC32 calculated string 01234567 N
|
||||
by Internet
|
||||
Archive
|
||||
--------------------------------------------------------------------------------------------------------------------------------------
|
||||
Name Help Type Example Read Only
|
||||
--------------------- ---------------------------------- ----------- -------------------------------------------- --------------------
|
||||
crc32 CRC32 calculated by Internet string 01234567 Y
|
||||
Archive
|
||||
|
||||
format Name of format string Comma-Separated Values N
|
||||
identified by
|
||||
Internet Archive
|
||||
format Name of format identified by string Comma-Separated Values Y
|
||||
Internet Archive
|
||||
|
||||
md5 MD5 hash string 01234567012345670123456701234567 N
|
||||
calculated by
|
||||
Internet Archive
|
||||
md5 MD5 hash calculated by Internet string 01234567012345670123456701234567 Y
|
||||
Archive
|
||||
|
||||
mtime Time of last RFC 3339 2006-01-02T15:04:05.999999999Z N
|
||||
modification,
|
||||
managed by Rclone
|
||||
mtime Time of last modification, managed RFC 3339 2006-01-02T15:04:05.999999999Z Y
|
||||
by Rclone
|
||||
|
||||
name Full file path, filename backend/internetarchive/internetarchive.go N
|
||||
without the bucket
|
||||
part
|
||||
name Full file path, without the bucket filename backend/internetarchive/internetarchive.go Y
|
||||
part
|
||||
|
||||
old_version Whether the file boolean true N
|
||||
was replaced and
|
||||
moved by
|
||||
keep-old-version
|
||||
flag
|
||||
old_version Whether the file was replaced and boolean true Y
|
||||
moved by keep-old-version flag
|
||||
|
||||
rclone-ia-mtime Time of last RFC 3339 2006-01-02T15:04:05.999999999Z N
|
||||
modification,
|
||||
managed by
|
||||
Internet Archive
|
||||
rclone-ia-mtime Time of last modification, managed RFC 3339 2006-01-02T15:04:05.999999999Z N
|
||||
by Internet Archive
|
||||
|
||||
rclone-mtime Time of last RFC 3339 2006-01-02T15:04:05.999999999Z N
|
||||
modification,
|
||||
managed by Rclone
|
||||
rclone-mtime Time of last modification, managed RFC 3339 2006-01-02T15:04:05.999999999Z N
|
||||
by Rclone
|
||||
|
||||
rclone-update-track Random value used string aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa N
|
||||
by Rclone for
|
||||
tracking changes
|
||||
inside Internet
|
||||
Archive
|
||||
rclone-update-track Random value used by Rclone for string aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa N
|
||||
tracking changes inside Internet
|
||||
Archive
|
||||
|
||||
sha1 SHA1 hash string 0123456701234567012345670123456701234567 N
|
||||
calculated by
|
||||
Internet Archive
|
||||
sha1 SHA1 hash calculated by Internet string 0123456701234567012345670123456701234567 Y
|
||||
Archive
|
||||
|
||||
size File size in bytes decimal 123456 N
|
||||
number
|
||||
size File size in bytes decimal 123456 Y
|
||||
number
|
||||
|
||||
source The source of the string original N
|
||||
file
|
||||
source The source of the file string original Y
|
||||
|
||||
viruscheck The last time unixtime 1654191352 N
|
||||
viruscheck process
|
||||
was run for the
|
||||
file (?)
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
summation Check string md5 Y
|
||||
https://forum.rclone.org/t/31922
|
||||
for how it is used
|
||||
|
||||
viruscheck The last time viruscheck process unixtime 1654191352 Y
|
||||
was run for the file (?)
|
||||
--------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
See the metadata docs for more info.
|
||||
|
||||
@@ -38939,6 +38931,79 @@ Options:
|
||||
|
||||
Changelog
|
||||
|
||||
v1.59.2 - 2022-09-15
|
||||
|
||||
See commits
|
||||
|
||||
- Bug Fixes
|
||||
- config: Move locking to fix fatal error: concurrent map read and
|
||||
map write (Nick Craig-Wood)
|
||||
- Local
|
||||
- Disable xattr support if the filesystems indicates it is not
|
||||
supported (Nick Craig-Wood)
|
||||
- Azure Blob
|
||||
- Fix chunksize calculations producing too many parts (Nick
|
||||
Craig-Wood)
|
||||
- B2
|
||||
- Fix chunksize calculations producing too many parts (Nick
|
||||
Craig-Wood)
|
||||
- S3
|
||||
- Fix chunksize calculations producing too many parts (Nick
|
||||
Craig-Wood)
|
||||
|
||||
v1.59.1 - 2022-08-08
|
||||
|
||||
See commits
|
||||
|
||||
- Bug Fixes
|
||||
- accounting: Fix panic in core/stats-reset with unknown group
|
||||
(Nick Craig-Wood)
|
||||
- build: Fix android build after GitHub actions change (Nick
|
||||
Craig-Wood)
|
||||
- dlna: Fix SOAP action header parsing (Joram Schrijver)
|
||||
- docs: Fix links to mount command from install docs (albertony)
|
||||
- dropox: Fix ChangeNotify was unable to decrypt errors (Nick
|
||||
Craig-Wood)
|
||||
- fs: Fix parsing of times and durations of the form "YYYY-MM-DD
|
||||
HH:MM:SS" (Nick Craig-Wood)
|
||||
- serve sftp: Fix checksum detection (Nick Craig-Wood)
|
||||
- sync: Add accidentally missed filter-sensitivity to --backup-dir
|
||||
option (Nick Naumann)
|
||||
- Combine
|
||||
- Fix docs showing remote= instead of upstreams= (Nick Craig-Wood)
|
||||
- Throw error if duplicate directory name is specified (Nick
|
||||
Craig-Wood)
|
||||
- Fix errors with backends shutting down while in use (Nick
|
||||
Craig-Wood)
|
||||
- Dropbox
|
||||
- Fix hang on quit with --dropbox-batch-mode off (Nick Craig-Wood)
|
||||
- Fix infinite loop on uploading a corrupted file (Nick
|
||||
Craig-Wood)
|
||||
- Internetarchive
|
||||
- Ignore checksums for files using the different method
|
||||
(Lesmiscore)
|
||||
- Handle hash symbol in the middle of filename (Lesmiscore)
|
||||
- Jottacloud
|
||||
- Fix working with whitelabel Elgiganten Cloud
|
||||
- Do not store username in config when using standard auth
|
||||
(albertony)
|
||||
- Mega
|
||||
- Fix nil pointer exception when bad node received (Nick
|
||||
Craig-Wood)
|
||||
- S3
|
||||
- Fix --s3-no-head panic: reflect: Elem of invalid type
|
||||
s3.PutObjectInput (Nick Craig-Wood)
|
||||
- SFTP
|
||||
- Fix issue with WS_FTP by working around failing RealPath
|
||||
(albertony)
|
||||
- Union
|
||||
- Fix duplicated files when using directories with leading / (Nick
|
||||
Craig-Wood)
|
||||
- Fix multiple files being uploaded when roots don't exist (Nick
|
||||
Craig-Wood)
|
||||
- Fix panic due to misalignment of struct field in 32 bit
|
||||
architectures (r-ricci)
|
||||
|
||||
v1.59.0 - 2022-07-09
|
||||
|
||||
See commits
|
||||
|
||||
@@ -1676,14 +1676,14 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||
}
|
||||
}
|
||||
|
||||
uploadParts := int64(maxUploadParts)
|
||||
uploadParts := maxUploadParts
|
||||
if uploadParts < 1 {
|
||||
uploadParts = 1
|
||||
} else if uploadParts > maxUploadParts {
|
||||
uploadParts = maxUploadParts
|
||||
}
|
||||
// calculate size of parts/blocks
|
||||
partSize := chunksize.Calculator(o, int(uploadParts), o.fs.opt.ChunkSize)
|
||||
partSize := chunksize.Calculator(o, src.Size(), uploadParts, o.fs.opt.ChunkSize)
|
||||
|
||||
putBlobOptions := azblob.UploadStreamToBlockBlobOptions{
|
||||
BufferSize: int(partSize),
|
||||
|
||||
@@ -97,7 +97,7 @@ func (f *Fs) newLargeUpload(ctx context.Context, o *Object, in io.Reader, src fs
|
||||
if size == -1 {
|
||||
fs.Debugf(o, "Streaming upload with --b2-chunk-size %s allows uploads of up to %s and will fail only when that limit is reached.", f.opt.ChunkSize, maxParts*f.opt.ChunkSize)
|
||||
} else {
|
||||
chunkSize = chunksize.Calculator(src, maxParts, defaultChunkSize)
|
||||
chunkSize = chunksize.Calculator(o, size, maxParts, defaultChunkSize)
|
||||
parts = size / int64(chunkSize)
|
||||
if size%int64(chunkSize) != 0 {
|
||||
parts++
|
||||
|
||||
@@ -758,9 +758,6 @@ func (f *Fs) shouldRetry(ctx context.Context, err error) (bool, error) {
|
||||
} else if f.opt.StopOnDownloadLimit && reason == "downloadQuotaExceeded" {
|
||||
fs.Errorf(f, "Received download limit error: %v", err)
|
||||
return false, fserrors.FatalError(err)
|
||||
} else if f.opt.StopOnUploadLimit && reason == "quotaExceeded" {
|
||||
fs.Errorf(f, "Received upload limit error: %v", err)
|
||||
return false, fserrors.FatalError(err)
|
||||
} else if f.opt.StopOnUploadLimit && reason == "teamDriveFileLimitExceeded" {
|
||||
fs.Errorf(f, "Received Shared Drive file limit error: %v", err)
|
||||
return false, fserrors.FatalError(err)
|
||||
|
||||
@@ -19,7 +19,6 @@ import (
|
||||
_ "github.com/rclone/rclone/backend/local"
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/filter"
|
||||
"github.com/rclone/rclone/fs/fserrors"
|
||||
"github.com/rclone/rclone/fs/hash"
|
||||
"github.com/rclone/rclone/fs/operations"
|
||||
"github.com/rclone/rclone/fs/sync"
|
||||
@@ -29,7 +28,6 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/api/drive/v3"
|
||||
"google.golang.org/api/googleapi"
|
||||
)
|
||||
|
||||
func TestDriveScopes(t *testing.T) {
|
||||
@@ -192,60 +190,6 @@ func TestExtensionsForImportFormats(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *Fs) InternalTestShouldRetry(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
gatewayTimeout := googleapi.Error{
|
||||
Code: 503,
|
||||
}
|
||||
timeoutRetry, timeoutError := f.shouldRetry(ctx, &gatewayTimeout)
|
||||
assert.True(t, timeoutRetry)
|
||||
assert.Equal(t, &gatewayTimeout, timeoutError)
|
||||
generic403 := googleapi.Error{
|
||||
Code: 403,
|
||||
}
|
||||
rLEItem := googleapi.ErrorItem{
|
||||
Reason: "rateLimitExceeded",
|
||||
Message: "User rate limit exceeded.",
|
||||
}
|
||||
generic403.Errors = append(generic403.Errors, rLEItem)
|
||||
oldStopUpload := f.opt.StopOnUploadLimit
|
||||
oldStopDownload := f.opt.StopOnDownloadLimit
|
||||
f.opt.StopOnUploadLimit = true
|
||||
f.opt.StopOnDownloadLimit = true
|
||||
defer func() {
|
||||
f.opt.StopOnUploadLimit = oldStopUpload
|
||||
f.opt.StopOnDownloadLimit = oldStopDownload
|
||||
}()
|
||||
expectedRLError := fserrors.FatalError(&generic403)
|
||||
rateLimitRetry, rateLimitErr := f.shouldRetry(ctx, &generic403)
|
||||
assert.False(t, rateLimitRetry)
|
||||
assert.Equal(t, rateLimitErr, expectedRLError)
|
||||
dQEItem := googleapi.ErrorItem{
|
||||
Reason: "downloadQuotaExceeded",
|
||||
}
|
||||
generic403.Errors[0] = dQEItem
|
||||
expectedDQError := fserrors.FatalError(&generic403)
|
||||
downloadQuotaRetry, downloadQuotaError := f.shouldRetry(ctx, &generic403)
|
||||
assert.False(t, downloadQuotaRetry)
|
||||
assert.Equal(t, downloadQuotaError, expectedDQError)
|
||||
tDFLEItem := googleapi.ErrorItem{
|
||||
Reason: "teamDriveFileLimitExceeded",
|
||||
}
|
||||
generic403.Errors[0] = tDFLEItem
|
||||
expectedTDFLError := fserrors.FatalError(&generic403)
|
||||
teamDriveFileLimitRetry, teamDriveFileLimitError := f.shouldRetry(ctx, &generic403)
|
||||
assert.False(t, teamDriveFileLimitRetry)
|
||||
assert.Equal(t, teamDriveFileLimitError, expectedTDFLError)
|
||||
qEItem := googleapi.ErrorItem{
|
||||
Reason: "quotaExceeded",
|
||||
}
|
||||
generic403.Errors[0] = qEItem
|
||||
expectedQuotaError := fserrors.FatalError(&generic403)
|
||||
quotaExceededRetry, quotaExceededError := f.shouldRetry(ctx, &generic403)
|
||||
assert.False(t, quotaExceededRetry)
|
||||
assert.Equal(t, quotaExceededError, expectedQuotaError)
|
||||
}
|
||||
|
||||
func (f *Fs) InternalTestDocumentImport(t *testing.T) {
|
||||
oldAllow := f.opt.AllowImportNameChange
|
||||
f.opt.AllowImportNameChange = true
|
||||
@@ -601,7 +545,6 @@ func (f *Fs) InternalTest(t *testing.T) {
|
||||
t.Run("UnTrash", f.InternalTestUnTrash)
|
||||
t.Run("CopyID", f.InternalTestCopyID)
|
||||
t.Run("AgeQuery", f.InternalTestAgeQuery)
|
||||
t.Run("ShouldRetry", f.InternalTestShouldRetry)
|
||||
}
|
||||
|
||||
var _ fstests.InternalTester = (*Fs)(nil)
|
||||
+13
-9
@@ -234,15 +234,16 @@ type Options struct {
|
||||
|
||||
// Fs represents a local filesystem rooted at root
|
||||
type Fs struct {
|
||||
name string // the name of the remote
|
||||
root string // The root directory (OS path)
|
||||
opt Options // parsed config options
|
||||
features *fs.Features // optional features
|
||||
dev uint64 // device number of root node
|
||||
precisionOk sync.Once // Whether we need to read the precision
|
||||
precision time.Duration // precision of local filesystem
|
||||
warnedMu sync.Mutex // used for locking access to 'warned'.
|
||||
warned map[string]struct{} // whether we have warned about this string
|
||||
name string // the name of the remote
|
||||
root string // The root directory (OS path)
|
||||
opt Options // parsed config options
|
||||
features *fs.Features // optional features
|
||||
dev uint64 // device number of root node
|
||||
precisionOk sync.Once // Whether we need to read the precision
|
||||
precision time.Duration // precision of local filesystem
|
||||
warnedMu sync.Mutex // used for locking access to 'warned'.
|
||||
warned map[string]struct{} // whether we have warned about this string
|
||||
xattrSupported int32 // whether xattrs are supported (atomic access)
|
||||
|
||||
// do os.Lstat or os.Stat
|
||||
lstat func(name string) (os.FileInfo, error)
|
||||
@@ -286,6 +287,9 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||
dev: devUnset,
|
||||
lstat: os.Lstat,
|
||||
}
|
||||
if xattrSupported {
|
||||
f.xattrSupported = 1
|
||||
}
|
||||
f.root = cleanRootPath(root, f.opt.NoUNC, f.opt.Enc)
|
||||
f.features = (&fs.Features{
|
||||
CaseInsensitive: f.caseInsensitive(),
|
||||
|
||||
+31
-2
@@ -6,6 +6,8 @@ package local
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
|
||||
"github.com/pkg/xattr"
|
||||
"github.com/rclone/rclone/fs"
|
||||
@@ -16,12 +18,30 @@ const (
|
||||
xattrSupported = xattr.XATTR_SUPPORTED
|
||||
)
|
||||
|
||||
// Check to see if the error supplied is a not supported error, and if
|
||||
// so, disable xattrs
|
||||
func (f *Fs) xattrIsNotSupported(err error) bool {
|
||||
xattrErr, ok := err.(*xattr.Error)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
// Xattrs not supported can be ENOTSUP or ENOATTR or EINVAL (on Solaris)
|
||||
if xattrErr.Err == syscall.EINVAL || xattrErr.Err == syscall.ENOTSUP || xattrErr.Err == xattr.ENOATTR {
|
||||
// Show xattrs not supported
|
||||
if atomic.CompareAndSwapInt32(&f.xattrSupported, 1, 0) {
|
||||
fs.Errorf(f, "xattrs not supported - disabling: %v", err)
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// getXattr returns the extended attributes for an object
|
||||
//
|
||||
// It doesn't return any attributes owned by this backend in
|
||||
// metadataKeys
|
||||
func (o *Object) getXattr() (metadata fs.Metadata, err error) {
|
||||
if !xattrSupported {
|
||||
if !xattrSupported || atomic.LoadInt32(&o.fs.xattrSupported) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
var list []string
|
||||
@@ -31,6 +51,9 @@ func (o *Object) getXattr() (metadata fs.Metadata, err error) {
|
||||
list, err = xattr.LList(o.path)
|
||||
}
|
||||
if err != nil {
|
||||
if o.fs.xattrIsNotSupported(err) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, fmt.Errorf("failed to read xattr: %w", err)
|
||||
}
|
||||
if len(list) == 0 {
|
||||
@@ -45,6 +68,9 @@ func (o *Object) getXattr() (metadata fs.Metadata, err error) {
|
||||
v, err = xattr.LGet(o.path, k)
|
||||
}
|
||||
if err != nil {
|
||||
if o.fs.xattrIsNotSupported(err) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, fmt.Errorf("failed to read xattr key %q: %w", k, err)
|
||||
}
|
||||
k = strings.ToLower(k)
|
||||
@@ -64,7 +90,7 @@ func (o *Object) getXattr() (metadata fs.Metadata, err error) {
|
||||
//
|
||||
// It doesn't set any attributes owned by this backend in metadataKeys
|
||||
func (o *Object) setXattr(metadata fs.Metadata) (err error) {
|
||||
if !xattrSupported {
|
||||
if !xattrSupported || atomic.LoadInt32(&o.fs.xattrSupported) == 0 {
|
||||
return nil
|
||||
}
|
||||
for k, value := range metadata {
|
||||
@@ -80,6 +106,9 @@ func (o *Object) setXattr(metadata fs.Metadata) (err error) {
|
||||
err = xattr.LSet(o.path, k, v)
|
||||
}
|
||||
if err != nil {
|
||||
if o.fs.xattrIsNotSupported(err) {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("failed to set xattr key %q: %w", k, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ func init() {
|
||||
Help: "Microsoft Cloud Germany",
|
||||
}, {
|
||||
Value: regionCN,
|
||||
Help: "Azure and Office 365 operated by Vnet Group in China",
|
||||
Help: "Azure and Office 365 operated by 21Vianet in China",
|
||||
},
|
||||
},
|
||||
}, {
|
||||
@@ -2184,7 +2184,7 @@ func (o *Object) ID() string {
|
||||
* 3. To avoid region-related issues, please don't manually build rest.Opts from scratch.
|
||||
* Instead, use these helper function, and customize the URL afterwards if needed.
|
||||
*
|
||||
* currently, the Vnet Group's API differs in the following places:
|
||||
* currently, the 21ViaNet's API differs in the following places:
|
||||
* - https://{Endpoint}/drives/{driveID}/items/{leaf}:/{route}
|
||||
* - this API doesn't work (gives invalid request)
|
||||
* - can be replaced with the following API:
|
||||
@@ -2233,7 +2233,7 @@ func escapeSingleQuote(str string) string {
|
||||
// newOptsCallWithIDPath build the rest.Opts structure with *a normalizedID (driveID#fileID, or simply fileID) and leaf*
|
||||
// using url template https://{Endpoint}/drives/{driveID}/items/{leaf}:/{route} (for international OneDrive)
|
||||
// or https://{Endpoint}/drives/{driveID}/items/children('{leaf}')/{route}
|
||||
// and https://{Endpoint}/drives/{driveID}/items/children('@a1')/{route}?@a1=URLEncode("'{leaf}'") (for Vnet Group)
|
||||
// and https://{Endpoint}/drives/{driveID}/items/children('@a1')/{route}?@a1=URLEncode("'{leaf}'") (for 21ViaNet)
|
||||
// if isPath is false, this function will only work when the leaf is "" or a child name (i.e. it doesn't accept multi-level leaf)
|
||||
// if isPath is true, multi-level leaf like a/b/c can be passed
|
||||
func (f *Fs) newOptsCallWithIDPath(normalizedID string, leaf string, isPath bool, method string, route string) (opts rest.Opts, ok bool) {
|
||||
|
||||
+3
-3
@@ -2076,7 +2076,7 @@ type Options struct {
|
||||
UploadCutoff fs.SizeSuffix `config:"upload_cutoff"`
|
||||
CopyCutoff fs.SizeSuffix `config:"copy_cutoff"`
|
||||
ChunkSize fs.SizeSuffix `config:"chunk_size"`
|
||||
MaxUploadParts int64 `config:"max_upload_parts"`
|
||||
MaxUploadParts int `config:"max_upload_parts"`
|
||||
DisableChecksum bool `config:"disable_checksum"`
|
||||
SharedCredentialsFile string `config:"shared_credentials_file"`
|
||||
Profile string `config:"profile"`
|
||||
@@ -4108,10 +4108,10 @@ func (o *Object) uploadMultipart(ctx context.Context, req *s3.PutObjectInput, si
|
||||
if size == -1 {
|
||||
warnStreamUpload.Do(func() {
|
||||
fs.Logf(f, "Streaming uploads using chunk size %v will have maximum file size of %v",
|
||||
f.opt.ChunkSize, fs.SizeSuffix(int64(partSize)*uploadParts))
|
||||
f.opt.ChunkSize, fs.SizeSuffix(int64(partSize)*int64(uploadParts)))
|
||||
})
|
||||
} else {
|
||||
partSize = chunksize.Calculator(o, int(uploadParts), f.opt.ChunkSize)
|
||||
partSize = chunksize.Calculator(o, size, uploadParts, f.opt.ChunkSize)
|
||||
}
|
||||
|
||||
memPool := f.getMemoryPool(int64(partSize))
|
||||
|
||||
@@ -186,7 +186,7 @@ func (s *server) rootDescHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// Handle a service control HTTP request.
|
||||
func (s *server) serviceControlHandler(w http.ResponseWriter, r *http.Request) {
|
||||
soapActionString := r.Header.Get("SOAPACTION")
|
||||
soapAction, err := parseActionHTTPHeader(soapActionString)
|
||||
soapAction, err := upnp.ParseActionHTTPHeader(soapActionString)
|
||||
if err != nil {
|
||||
serveError(s, w, "Could not parse SOAPACTION header", err)
|
||||
return
|
||||
|
||||
@@ -119,6 +119,8 @@ func TestContentDirectoryBrowseMetadata(t *testing.T) {
|
||||
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
require.NoError(t, err)
|
||||
// should contain an appropriate URN
|
||||
require.Contains(t, string(body), "urn:schemas-upnp-org:service:ContentDirectory:1")
|
||||
// expect a <container> element
|
||||
require.Contains(t, string(body), html.EscapeString("<container "))
|
||||
require.NotContains(t, string(body), html.EscapeString("<item "))
|
||||
|
||||
@@ -3,7 +3,6 @@ package dlna
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
@@ -12,9 +11,6 @@ import (
|
||||
"net/http/httptest"
|
||||
"net/http/httputil"
|
||||
"os"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/anacrolix/dms/soap"
|
||||
"github.com/anacrolix/dms/upnp"
|
||||
@@ -89,36 +85,6 @@ func marshalSOAPResponse(sa upnp.SoapAction, args map[string]string) []byte {
|
||||
sa.Action, sa.ServiceURN.String(), mustMarshalXML(soapArgs)))
|
||||
}
|
||||
|
||||
var serviceURNRegexp = regexp.MustCompile(`:service:(\w+):(\d+)$`)
|
||||
|
||||
func parseServiceType(s string) (ret upnp.ServiceURN, err error) {
|
||||
matches := serviceURNRegexp.FindStringSubmatch(s)
|
||||
if matches == nil {
|
||||
err = errors.New(s)
|
||||
return
|
||||
}
|
||||
if len(matches) != 3 {
|
||||
log.Panicf("Invalid serviceURNRegexp ?")
|
||||
}
|
||||
ret.Type = matches[1]
|
||||
ret.Version, err = strconv.ParseUint(matches[2], 0, 0)
|
||||
return
|
||||
}
|
||||
|
||||
func parseActionHTTPHeader(s string) (ret upnp.SoapAction, err error) {
|
||||
if s[0] != '"' || s[len(s)-1] != '"' {
|
||||
return
|
||||
}
|
||||
s = s[1 : len(s)-1]
|
||||
hashIndex := strings.LastIndex(s, "#")
|
||||
if hashIndex == -1 {
|
||||
return
|
||||
}
|
||||
ret.Action = s[hashIndex+1:]
|
||||
ret.ServiceURN, err = parseServiceType(s[:hashIndex])
|
||||
return
|
||||
}
|
||||
|
||||
type loggingResponseWriter struct {
|
||||
http.ResponseWriter
|
||||
request *http.Request
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build go1.17
|
||||
// +build go1.17
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build go1.17
|
||||
// +build go1.17
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// Package restic serves a remote suitable for use with restic
|
||||
|
||||
//go:build go1.17
|
||||
// +build go1.17
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build go1.17
|
||||
// +build go1.17
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build go1.17
|
||||
// +build go1.17
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// Serve restic tests set up a server and run the integration tests
|
||||
// for restic against it.
|
||||
|
||||
//go:build go1.17
|
||||
// +build go1.17
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// Build for restic for unsupported platforms to stop go complaining
|
||||
// about "no buildable Go source files "
|
||||
|
||||
//go:build !go1.17
|
||||
// +build !go1.17
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// Command definition for cobra
|
||||
var Command *cobra.Command
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build go1.17
|
||||
// +build go1.17
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build go1.17
|
||||
// +build go1.17
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
|
||||
@@ -101,6 +101,9 @@ func (c *conn) execCommand(ctx context.Context, out io.Writer, command string) (
|
||||
if binary == "sha1sum" {
|
||||
ht = hash.SHA1
|
||||
}
|
||||
if !c.vfs.Fs().Hashes().Contains(ht) {
|
||||
return fmt.Errorf("%v hash not supported", ht)
|
||||
}
|
||||
var hashSum string
|
||||
if args == "" {
|
||||
// empty hash for no input
|
||||
|
||||
@@ -626,7 +626,3 @@ put them back in again.` >}}
|
||||
* Lorenzo Maiorfi <maiorfi@gmail.com>
|
||||
* Claudio Maradonna <penguyman@stronzi.org>
|
||||
* Ovidiu Victor Tatar <ovi.tatar@googlemail.com>
|
||||
* Evan Spensley <epspensley@gmail.com>
|
||||
* Yen Hu <61753151+0x59656e@users.noreply.github.com>
|
||||
* Steve Kowalik <steven@wedontsleep.org>
|
||||
* Jordi Gonzalez Muñoz <jordigonzm@gmail.com>
|
||||
@@ -5,6 +5,58 @@ description: "Rclone Changelog"
|
||||
|
||||
# Changelog
|
||||
|
||||
## v1.59.2 - 2022-09-15
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.59.1...v1.59.2)
|
||||
|
||||
* Bug Fixes
|
||||
* config: Move locking to fix fatal error: concurrent map read and map write (Nick Craig-Wood)
|
||||
* Local
|
||||
* Disable xattr support if the filesystems indicates it is not supported (Nick Craig-Wood)
|
||||
* Azure Blob
|
||||
* Fix chunksize calculations producing too many parts (Nick Craig-Wood)
|
||||
* B2
|
||||
* Fix chunksize calculations producing too many parts (Nick Craig-Wood)
|
||||
* S3
|
||||
* Fix chunksize calculations producing too many parts (Nick Craig-Wood)
|
||||
|
||||
## v1.59.1 - 2022-08-08
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.59.0...v1.59.1)
|
||||
|
||||
* Bug Fixes
|
||||
* accounting: Fix panic in core/stats-reset with unknown group (Nick Craig-Wood)
|
||||
* build: Fix android build after GitHub actions change (Nick Craig-Wood)
|
||||
* dlna: Fix SOAP action header parsing (Joram Schrijver)
|
||||
* docs: Fix links to mount command from install docs (albertony)
|
||||
* dropox: Fix ChangeNotify was unable to decrypt errors (Nick Craig-Wood)
|
||||
* fs: Fix parsing of times and durations of the form "YYYY-MM-DD HH:MM:SS" (Nick Craig-Wood)
|
||||
* serve sftp: Fix checksum detection (Nick Craig-Wood)
|
||||
* sync: Add accidentally missed filter-sensitivity to --backup-dir option (Nick Naumann)
|
||||
* Combine
|
||||
* Fix docs showing `remote=` instead of `upstreams=` (Nick Craig-Wood)
|
||||
* Throw error if duplicate directory name is specified (Nick Craig-Wood)
|
||||
* Fix errors with backends shutting down while in use (Nick Craig-Wood)
|
||||
* Dropbox
|
||||
* Fix hang on quit with --dropbox-batch-mode off (Nick Craig-Wood)
|
||||
* Fix infinite loop on uploading a corrupted file (Nick Craig-Wood)
|
||||
* Internetarchive
|
||||
* Ignore checksums for files using the different method (Lesmiscore)
|
||||
* Handle hash symbol in the middle of filename (Lesmiscore)
|
||||
* Jottacloud
|
||||
* Fix working with whitelabel Elgiganten Cloud
|
||||
* Do not store username in config when using standard auth (albertony)
|
||||
* Mega
|
||||
* Fix nil pointer exception when bad node received (Nick Craig-Wood)
|
||||
* S3
|
||||
* Fix --s3-no-head panic: reflect: Elem of invalid type s3.PutObjectInput (Nick Craig-Wood)
|
||||
* SFTP
|
||||
* Fix issue with WS_FTP by working around failing RealPath (albertony)
|
||||
* Union
|
||||
* Fix duplicated files when using directories with leading / (Nick Craig-Wood)
|
||||
* Fix multiple files being uploaded when roots don't exist (Nick Craig-Wood)
|
||||
* Fix panic due to misalignment of struct field in 32 bit architectures (r-ricci)
|
||||
|
||||
## v1.59.0 - 2022-07-09
|
||||
|
||||
[See commits](https://github.com/rclone/rclone/compare/v1.58.0...v1.59.0)
|
||||
|
||||
@@ -37,6 +37,11 @@ extended explanation in the [copy](/commands/rclone_copy/) command if unsure.
|
||||
If dest:path doesn't exist, it is created and the source:path contents
|
||||
go there.
|
||||
|
||||
It is not possible to sync overlapping remotes. However, you may exclude
|
||||
the destination from the sync with a filter rule or by putting an
|
||||
exclude-if-present file inside the destination directory and sync to a
|
||||
destination that is inside the source directory.
|
||||
|
||||
**Note**: Use the `-P`/`--progress` flag to view real-time transfer statistics
|
||||
|
||||
**Note**: Use the `rclone dedupe` command to deal with "Duplicate object/directory found in source/destination - ignoring" errors.
|
||||
|
||||
@@ -1644,18 +1644,6 @@ This sets the interval between each retry specified by `--retries`
|
||||
|
||||
The default is `0`. Use `0` to disable.
|
||||
|
||||
### --server-side-across-configs ###
|
||||
|
||||
Allow server-side operations (e.g. copy or move) to work across
|
||||
different configurations.
|
||||
|
||||
This can be useful if you wish to do a server-side copy or move
|
||||
between two remotes which use the same backend but are configured
|
||||
differently.
|
||||
|
||||
Note that this isn't enabled by default because it isn't easy for
|
||||
rclone to tell if it will work between any two configurations.
|
||||
|
||||
### --size-only ###
|
||||
|
||||
Normally rclone will look at modification time and size of files to
|
||||
|
||||
@@ -160,7 +160,7 @@ These flags are available for every command.
|
||||
--use-json-log Use json log format
|
||||
--use-mmap Use mmap allocator (see docs)
|
||||
--use-server-modtime Use server modified time instead of object metadata
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.59.0")
|
||||
--user-agent string Set the user-agent to a specified string (default "rclone/v1.59.2")
|
||||
-v, --verbose count Print lots more stuff (repeat for more)
|
||||
```
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ kill %1
|
||||
## Install from source
|
||||
|
||||
Make sure you have git and [Go](https://golang.org/) installed.
|
||||
Go version 1.17 or newer is required, latest release is recommended.
|
||||
Go version 1.16 or newer is required, latest release is recommended.
|
||||
You can get it from your package manager, or download it from
|
||||
[golang.org/dl](https://golang.org/dl/). Then you can run the following:
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ Properties:
|
||||
- "de"
|
||||
- Microsoft Cloud Germany
|
||||
- "cn"
|
||||
- Azure and Office 365 operated by Vnet Group in China
|
||||
- Azure and Office 365 operated by 21Vianet in China
|
||||
|
||||
### Advanced options
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
v1.60.0
|
||||
v1.59.2
|
||||
@@ -2,6 +2,7 @@ package accounting
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/rclone/rclone/fs/rc"
|
||||
@@ -190,6 +191,9 @@ func rcResetStats(ctx context.Context, in rc.Params) (rc.Params, error) {
|
||||
|
||||
if group != "" {
|
||||
stats := groups.get(group)
|
||||
if stats == nil {
|
||||
return rc.Params{}, fmt.Errorf("group %q not found", group)
|
||||
}
|
||||
stats.ResetErrors()
|
||||
stats.ResetCounters()
|
||||
} else {
|
||||
|
||||
@@ -7,8 +7,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/rclone/rclone/fs/rc"
|
||||
"github.com/rclone/rclone/fstest/testy"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestStatsGroupOperations(t *testing.T) {
|
||||
@@ -117,6 +119,89 @@ func TestStatsGroupOperations(t *testing.T) {
|
||||
t.Errorf("HeapObjects = %d, expected %d", end.HeapObjects, start.HeapObjects)
|
||||
}
|
||||
})
|
||||
|
||||
testGroupStatsInfo := NewStatsGroup(ctx, "test-group")
|
||||
testGroupStatsInfo.Deletes(1)
|
||||
GlobalStats().Deletes(41)
|
||||
|
||||
t.Run("core/group-list", func(t *testing.T) {
|
||||
call := rc.Calls.Get("core/group-list")
|
||||
require.NotNil(t, call)
|
||||
got, err := call.Fn(ctx, rc.Params{})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, rc.Params{
|
||||
"groups": []string{
|
||||
"test-group",
|
||||
},
|
||||
}, got)
|
||||
})
|
||||
|
||||
t.Run("core/stats", func(t *testing.T) {
|
||||
call := rc.Calls.Get("core/stats")
|
||||
require.NotNil(t, call)
|
||||
gotNoGroup, err := call.Fn(ctx, rc.Params{})
|
||||
require.NoError(t, err)
|
||||
gotGroup, err := call.Fn(ctx, rc.Params{"group": "test-group"})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, int64(42), gotNoGroup["deletes"])
|
||||
assert.Equal(t, int64(1), gotGroup["deletes"])
|
||||
})
|
||||
|
||||
t.Run("core/transferred", func(t *testing.T) {
|
||||
call := rc.Calls.Get("core/transferred")
|
||||
require.NotNil(t, call)
|
||||
gotNoGroup, err := call.Fn(ctx, rc.Params{})
|
||||
require.NoError(t, err)
|
||||
gotGroup, err := call.Fn(ctx, rc.Params{"group": "test-group"})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, rc.Params{
|
||||
"transferred": []TransferSnapshot{},
|
||||
}, gotNoGroup)
|
||||
assert.Equal(t, rc.Params{
|
||||
"transferred": []TransferSnapshot{},
|
||||
}, gotGroup)
|
||||
})
|
||||
|
||||
t.Run("core/stats-reset", func(t *testing.T) {
|
||||
call := rc.Calls.Get("core/stats-reset")
|
||||
require.NotNil(t, call)
|
||||
|
||||
assert.Equal(t, int64(41), GlobalStats().deletes)
|
||||
assert.Equal(t, int64(1), testGroupStatsInfo.deletes)
|
||||
|
||||
_, err := call.Fn(ctx, rc.Params{"group": "test-group"})
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, int64(41), GlobalStats().deletes)
|
||||
assert.Equal(t, int64(0), testGroupStatsInfo.deletes)
|
||||
|
||||
_, err = call.Fn(ctx, rc.Params{})
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, int64(0), GlobalStats().deletes)
|
||||
assert.Equal(t, int64(0), testGroupStatsInfo.deletes)
|
||||
|
||||
_, err = call.Fn(ctx, rc.Params{"group": "not-found"})
|
||||
require.ErrorContains(t, err, `group "not-found" not found`)
|
||||
|
||||
})
|
||||
|
||||
testGroupStatsInfo = NewStatsGroup(ctx, "test-group")
|
||||
|
||||
t.Run("core/stats-delete", func(t *testing.T) {
|
||||
call := rc.Calls.Get("core/stats-delete")
|
||||
require.NotNil(t, call)
|
||||
|
||||
assert.Equal(t, []string{"test-group"}, groups.names())
|
||||
|
||||
_, err := call.Fn(ctx, rc.Params{"group": "test-group"})
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, []string{}, groups.names())
|
||||
|
||||
_, err = call.Fn(ctx, rc.Params{"group": "not-found"})
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
func percentDiff(start, end uint64) uint64 {
|
||||
|
||||
+20
-12
@@ -5,18 +5,26 @@ import (
|
||||
"github.com/rclone/rclone/fs"
|
||||
)
|
||||
|
||||
/*
|
||||
Calculator calculates the minimum chunk size needed to fit within the maximum number of parts, rounded up to the nearest fs.Mebi
|
||||
// Calculator calculates the minimum chunk size needed to fit within
|
||||
// the maximum number of parts, rounded up to the nearest fs.Mebi.
|
||||
//
|
||||
// For most backends, (chunk_size) * (concurrent_upload_routines)
|
||||
// memory will be required so we want to use the smallest possible
|
||||
// chunk size that's going to allow the upload to proceed. Rounding up
|
||||
// to the nearest fs.Mebi on the assumption that some backends may
|
||||
// only allow integer type parameters when specifying the chunk size.
|
||||
//
|
||||
// Returns the default chunk size if it is sufficiently large enough
|
||||
// to support the given file size otherwise returns the smallest chunk
|
||||
// size necessary to allow the upload to proceed.
|
||||
func Calculator(o interface{}, size int64, maxParts int, defaultChunkSize fs.SizeSuffix) fs.SizeSuffix {
|
||||
// If streaming then use default chunk size
|
||||
if size < 0 {
|
||||
fs.Debugf(o, "Streaming upload with chunk_size %s allows uploads of up to %s and will fail only when that limit is reached.", defaultChunkSize, fs.SizeSuffix(maxParts)*defaultChunkSize)
|
||||
|
||||
For most backends, (chunk_size) * (concurrent_upload_routines) memory will be required so we want to use the smallest
|
||||
possible chunk size that's going to allow the upload to proceed. Rounding up to the nearest fs.Mebi on the assumption
|
||||
that some backends may only allow integer type parameters when specifying the chunk size.
|
||||
|
||||
Returns the default chunk size if it is sufficiently large enough to support the given file size otherwise returns the
|
||||
smallest chunk size necessary to allow the upload to proceed.
|
||||
*/
|
||||
func Calculator(objInfo fs.ObjectInfo, maxParts int, defaultChunkSize fs.SizeSuffix) fs.SizeSuffix {
|
||||
fileSize := fs.SizeSuffix(objInfo.Size())
|
||||
return defaultChunkSize
|
||||
}
|
||||
fileSize := fs.SizeSuffix(size)
|
||||
requiredChunks := fileSize / defaultChunkSize
|
||||
if requiredChunks < fs.SizeSuffix(maxParts) || (requiredChunks == fs.SizeSuffix(maxParts) && fileSize%defaultChunkSize == 0) {
|
||||
return defaultChunkSize
|
||||
@@ -31,6 +39,6 @@ func Calculator(objInfo fs.ObjectInfo, maxParts int, defaultChunkSize fs.SizeSuf
|
||||
minChunk += fs.Mebi
|
||||
}
|
||||
|
||||
fs.Debugf(objInfo, "size: %v, parts: %v, default: %v, new: %v; default chunk size insufficient, returned new chunk size", fileSize, maxParts, defaultChunkSize, minChunk)
|
||||
fs.Debugf(o, "size: %v, parts: %v, default: %v, new: %v; default chunk size insufficient, returned new chunk size", fileSize, maxParts, defaultChunkSize, minChunk)
|
||||
return minChunk
|
||||
}
|
||||
@@ -2,34 +2,100 @@ package chunksize
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
"github.com/rclone/rclone/fs/object"
|
||||
)
|
||||
|
||||
func TestComputeChunkSize(t *testing.T) {
|
||||
tests := map[string]struct {
|
||||
fileSize fs.SizeSuffix
|
||||
for _, test := range []struct {
|
||||
name string
|
||||
size fs.SizeSuffix
|
||||
maxParts int
|
||||
defaultChunkSize fs.SizeSuffix
|
||||
expected fs.SizeSuffix
|
||||
want fs.SizeSuffix
|
||||
}{
|
||||
"default size returned when file size is small enough": {fileSize: 1000, maxParts: 10000, defaultChunkSize: toSizeSuffixMiB(10), expected: toSizeSuffixMiB(10)},
|
||||
"default size returned when file size is just 1 byte small enough": {fileSize: toSizeSuffixMiB(100000) - 1, maxParts: 10000, defaultChunkSize: toSizeSuffixMiB(10), expected: toSizeSuffixMiB(10)},
|
||||
"no rounding up when everything divides evenly": {fileSize: toSizeSuffixMiB(1000000), maxParts: 10000, defaultChunkSize: toSizeSuffixMiB(100), expected: toSizeSuffixMiB(100)},
|
||||
"rounding up to nearest MiB when not quite enough parts": {fileSize: toSizeSuffixMiB(1000000), maxParts: 9999, defaultChunkSize: toSizeSuffixMiB(100), expected: toSizeSuffixMiB(101)},
|
||||
"rounding up to nearest MiB when one extra byte": {fileSize: toSizeSuffixMiB(1000000) + 1, maxParts: 10000, defaultChunkSize: toSizeSuffixMiB(100), expected: toSizeSuffixMiB(101)},
|
||||
"expected MiB value when rounding sets to absolute minimum": {fileSize: toSizeSuffixMiB(1) - 1, maxParts: 1, defaultChunkSize: toSizeSuffixMiB(1), expected: toSizeSuffixMiB(1)},
|
||||
"expected MiB value when rounding to absolute min with extra": {fileSize: toSizeSuffixMiB(1) + 1, maxParts: 1, defaultChunkSize: toSizeSuffixMiB(1), expected: toSizeSuffixMiB(2)},
|
||||
}
|
||||
{
|
||||
name: "streaming file",
|
||||
size: -1,
|
||||
maxParts: 10000,
|
||||
defaultChunkSize: toSizeSuffixMiB(10),
|
||||
want: toSizeSuffixMiB(10),
|
||||
}, {
|
||||
name: "default size returned when file size is small enough",
|
||||
size: 1000,
|
||||
maxParts: 10000,
|
||||
defaultChunkSize: toSizeSuffixMiB(10),
|
||||
want: toSizeSuffixMiB(10),
|
||||
}, {
|
||||
name: "default size returned when file size is just 1 byte small enough",
|
||||
size: toSizeSuffixMiB(100000) - 1,
|
||||
maxParts: 10000,
|
||||
defaultChunkSize: toSizeSuffixMiB(10),
|
||||
want: toSizeSuffixMiB(10),
|
||||
}, {
|
||||
name: "no rounding up when everything divides evenly",
|
||||
size: toSizeSuffixMiB(1000000),
|
||||
maxParts: 10000,
|
||||
defaultChunkSize: toSizeSuffixMiB(100),
|
||||
want: toSizeSuffixMiB(100),
|
||||
}, {
|
||||
name: "rounding up to nearest MiB when not quite enough parts",
|
||||
size: toSizeSuffixMiB(1000000),
|
||||
maxParts: 9999,
|
||||
defaultChunkSize: toSizeSuffixMiB(100),
|
||||
want: toSizeSuffixMiB(101),
|
||||
}, {
|
||||
name: "rounding up to nearest MiB when one extra byte",
|
||||
size: toSizeSuffixMiB(1000000) + 1,
|
||||
maxParts: 10000,
|
||||
defaultChunkSize: toSizeSuffixMiB(100),
|
||||
want: toSizeSuffixMiB(101),
|
||||
}, {
|
||||
name: "expected MiB value when rounding sets to absolute minimum",
|
||||
size: toSizeSuffixMiB(1) - 1,
|
||||
maxParts: 1,
|
||||
defaultChunkSize: toSizeSuffixMiB(1),
|
||||
want: toSizeSuffixMiB(1),
|
||||
}, {
|
||||
name: "expected MiB value when rounding to absolute min with extra",
|
||||
size: toSizeSuffixMiB(1) + 1,
|
||||
maxParts: 1,
|
||||
defaultChunkSize: toSizeSuffixMiB(1),
|
||||
want: toSizeSuffixMiB(2),
|
||||
}, {
|
||||
name: "issue from forum #1",
|
||||
size: 120864818840,
|
||||
maxParts: 10000,
|
||||
defaultChunkSize: 5 * 1024 * 1024,
|
||||
want: toSizeSuffixMiB(12),
|
||||
},
|
||||
} {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
got := Calculator(test.name, int64(test.size), test.maxParts, test.defaultChunkSize)
|
||||
if got != test.want {
|
||||
t.Fatalf("expected: %v, got: %v", test.want, got)
|
||||
}
|
||||
if test.size < 0 {
|
||||
return
|
||||
}
|
||||
parts := func(result fs.SizeSuffix) int {
|
||||
n := test.size / result
|
||||
r := test.size % result
|
||||
if r != 0 {
|
||||
n++
|
||||
}
|
||||
return int(n)
|
||||
}
|
||||
// Check this gives the parts in range
|
||||
if parts(got) > test.maxParts {
|
||||
t.Fatalf("too many parts %d", parts(got))
|
||||
}
|
||||
// Check that setting chunk size smaller gave too many parts
|
||||
if got > test.defaultChunkSize {
|
||||
if parts(got-toSizeSuffixMiB(1)) <= test.maxParts {
|
||||
t.Fatalf("chunk size %v too big as %v only gives %d parts", got, got-toSizeSuffixMiB(1), parts(got-toSizeSuffixMiB(1)))
|
||||
}
|
||||
|
||||
for name, tc := range tests {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
src := object.NewStaticObjectInfo("mock", time.Now(), int64(tc.fileSize), true, nil, nil)
|
||||
result := Calculator(src, tc.maxParts, tc.defaultChunkSize)
|
||||
if result != tc.expected {
|
||||
t.Fatalf("expected: %v, got: %v", tc.expected, result)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+90
-91
@@ -45,97 +45,96 @@ var (
|
||||
|
||||
// ConfigInfo is filesystem config options
|
||||
type ConfigInfo struct {
|
||||
LogLevel LogLevel
|
||||
StatsLogLevel LogLevel
|
||||
UseJSONLog bool
|
||||
DryRun bool
|
||||
Interactive bool
|
||||
CheckSum bool
|
||||
SizeOnly bool
|
||||
IgnoreTimes bool
|
||||
IgnoreExisting bool
|
||||
IgnoreErrors bool
|
||||
ModifyWindow time.Duration
|
||||
Checkers int
|
||||
Transfers int
|
||||
ConnectTimeout time.Duration // Connect timeout
|
||||
Timeout time.Duration // Data channel timeout
|
||||
ExpectContinueTimeout time.Duration
|
||||
Dump DumpFlags
|
||||
InsecureSkipVerify bool // Skip server certificate verification
|
||||
DeleteMode DeleteMode
|
||||
MaxDelete int64
|
||||
TrackRenames bool // Track file renames.
|
||||
TrackRenamesStrategy string // Comma separated list of strategies used to track renames
|
||||
LowLevelRetries int
|
||||
UpdateOlder bool // Skip files that are newer on the destination
|
||||
NoGzip bool // Disable compression
|
||||
MaxDepth int
|
||||
IgnoreSize bool
|
||||
IgnoreChecksum bool
|
||||
IgnoreCaseSync bool
|
||||
NoTraverse bool
|
||||
CheckFirst bool
|
||||
NoCheckDest bool
|
||||
NoUnicodeNormalization bool
|
||||
NoUpdateModTime bool
|
||||
DataRateUnit string
|
||||
CompareDest []string
|
||||
CopyDest []string
|
||||
BackupDir string
|
||||
Suffix string
|
||||
SuffixKeepExtension bool
|
||||
UseListR bool
|
||||
BufferSize SizeSuffix
|
||||
BwLimit BwTimetable
|
||||
BwLimitFile BwTimetable
|
||||
TPSLimit float64
|
||||
TPSLimitBurst int
|
||||
BindAddr net.IP
|
||||
DisableFeatures []string
|
||||
UserAgent string
|
||||
Immutable bool
|
||||
AutoConfirm bool
|
||||
StreamingUploadCutoff SizeSuffix
|
||||
StatsFileNameLength int
|
||||
AskPassword bool
|
||||
PasswordCommand SpaceSepList
|
||||
UseServerModTime bool
|
||||
MaxTransfer SizeSuffix
|
||||
MaxDuration time.Duration
|
||||
CutoffMode CutoffMode
|
||||
MaxBacklog int
|
||||
MaxStatsGroups int
|
||||
StatsOneLine bool
|
||||
StatsOneLineDate bool // If we want a date prefix at all
|
||||
StatsOneLineDateFormat string // If we want to customize the prefix
|
||||
ErrorOnNoTransfer bool // Set appropriate exit code if no files transferred
|
||||
Progress bool
|
||||
ProgressTerminalTitle bool
|
||||
Cookie bool
|
||||
UseMmap bool
|
||||
CaCert string // Client Side CA
|
||||
ClientCert string // Client Side Cert
|
||||
ClientKey string // Client Side Key
|
||||
MultiThreadCutoff SizeSuffix
|
||||
MultiThreadStreams int
|
||||
MultiThreadSet bool // whether MultiThreadStreams was set (set in fs/config/configflags)
|
||||
OrderBy string // instructions on how to order the transfer
|
||||
UploadHeaders []*HTTPOption
|
||||
DownloadHeaders []*HTTPOption
|
||||
Headers []*HTTPOption
|
||||
MetadataSet Metadata // extra metadata to write when uploading
|
||||
RefreshTimes bool
|
||||
NoConsole bool
|
||||
TrafficClass uint8
|
||||
FsCacheExpireDuration time.Duration
|
||||
FsCacheExpireInterval time.Duration
|
||||
DisableHTTP2 bool
|
||||
HumanReadable bool
|
||||
KvLockTime time.Duration // maximum time to keep key-value database locked by process
|
||||
DisableHTTPKeepAlives bool
|
||||
Metadata bool
|
||||
ServerSideAcrossConfigs bool
|
||||
LogLevel LogLevel
|
||||
StatsLogLevel LogLevel
|
||||
UseJSONLog bool
|
||||
DryRun bool
|
||||
Interactive bool
|
||||
CheckSum bool
|
||||
SizeOnly bool
|
||||
IgnoreTimes bool
|
||||
IgnoreExisting bool
|
||||
IgnoreErrors bool
|
||||
ModifyWindow time.Duration
|
||||
Checkers int
|
||||
Transfers int
|
||||
ConnectTimeout time.Duration // Connect timeout
|
||||
Timeout time.Duration // Data channel timeout
|
||||
ExpectContinueTimeout time.Duration
|
||||
Dump DumpFlags
|
||||
InsecureSkipVerify bool // Skip server certificate verification
|
||||
DeleteMode DeleteMode
|
||||
MaxDelete int64
|
||||
TrackRenames bool // Track file renames.
|
||||
TrackRenamesStrategy string // Comma separated list of strategies used to track renames
|
||||
LowLevelRetries int
|
||||
UpdateOlder bool // Skip files that are newer on the destination
|
||||
NoGzip bool // Disable compression
|
||||
MaxDepth int
|
||||
IgnoreSize bool
|
||||
IgnoreChecksum bool
|
||||
IgnoreCaseSync bool
|
||||
NoTraverse bool
|
||||
CheckFirst bool
|
||||
NoCheckDest bool
|
||||
NoUnicodeNormalization bool
|
||||
NoUpdateModTime bool
|
||||
DataRateUnit string
|
||||
CompareDest []string
|
||||
CopyDest []string
|
||||
BackupDir string
|
||||
Suffix string
|
||||
SuffixKeepExtension bool
|
||||
UseListR bool
|
||||
BufferSize SizeSuffix
|
||||
BwLimit BwTimetable
|
||||
BwLimitFile BwTimetable
|
||||
TPSLimit float64
|
||||
TPSLimitBurst int
|
||||
BindAddr net.IP
|
||||
DisableFeatures []string
|
||||
UserAgent string
|
||||
Immutable bool
|
||||
AutoConfirm bool
|
||||
StreamingUploadCutoff SizeSuffix
|
||||
StatsFileNameLength int
|
||||
AskPassword bool
|
||||
PasswordCommand SpaceSepList
|
||||
UseServerModTime bool
|
||||
MaxTransfer SizeSuffix
|
||||
MaxDuration time.Duration
|
||||
CutoffMode CutoffMode
|
||||
MaxBacklog int
|
||||
MaxStatsGroups int
|
||||
StatsOneLine bool
|
||||
StatsOneLineDate bool // If we want a date prefix at all
|
||||
StatsOneLineDateFormat string // If we want to customize the prefix
|
||||
ErrorOnNoTransfer bool // Set appropriate exit code if no files transferred
|
||||
Progress bool
|
||||
ProgressTerminalTitle bool
|
||||
Cookie bool
|
||||
UseMmap bool
|
||||
CaCert string // Client Side CA
|
||||
ClientCert string // Client Side Cert
|
||||
ClientKey string // Client Side Key
|
||||
MultiThreadCutoff SizeSuffix
|
||||
MultiThreadStreams int
|
||||
MultiThreadSet bool // whether MultiThreadStreams was set (set in fs/config/configflags)
|
||||
OrderBy string // instructions on how to order the transfer
|
||||
UploadHeaders []*HTTPOption
|
||||
DownloadHeaders []*HTTPOption
|
||||
Headers []*HTTPOption
|
||||
MetadataSet Metadata // extra metadata to write when uploading
|
||||
RefreshTimes bool
|
||||
NoConsole bool
|
||||
TrafficClass uint8
|
||||
FsCacheExpireDuration time.Duration
|
||||
FsCacheExpireInterval time.Duration
|
||||
DisableHTTP2 bool
|
||||
HumanReadable bool
|
||||
KvLockTime time.Duration // maximum time to keep key-value database locked by process
|
||||
DisableHTTPKeepAlives bool
|
||||
Metadata bool
|
||||
}
|
||||
|
||||
// NewConfig creates a new config with everything set to the default
|
||||
|
||||
@@ -24,16 +24,15 @@ func Install() {
|
||||
// Storage implements config.Storage for saving and loading config
|
||||
// data in a simple INI based file.
|
||||
type Storage struct {
|
||||
gc *goconfig.ConfigFile // config file loaded - thread safe
|
||||
mu sync.Mutex // to protect the following variables
|
||||
gc *goconfig.ConfigFile // config file loaded - not thread safe
|
||||
fi os.FileInfo // stat of the file when last loaded
|
||||
}
|
||||
|
||||
// Check to see if we need to reload the config
|
||||
func (s *Storage) check() {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
//
|
||||
// mu must be held when calling this
|
||||
func (s *Storage) _check() {
|
||||
if configPath := config.GetConfigPath(); configPath != "" {
|
||||
// Check to see if config file has changed since it was last loaded
|
||||
fi, err := os.Stat(configPath)
|
||||
@@ -174,7 +173,10 @@ func (s *Storage) Save() error {
|
||||
|
||||
// Serialize the config into a string
|
||||
func (s *Storage) Serialize() (string, error) {
|
||||
s.check()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
s._check()
|
||||
var buf bytes.Buffer
|
||||
if err := goconfig.SaveConfigData(s.gc, &buf); err != nil {
|
||||
return "", fmt.Errorf("failed to save config file: %w", err)
|
||||
@@ -185,7 +187,10 @@ func (s *Storage) Serialize() (string, error) {
|
||||
|
||||
// HasSection returns true if section exists in the config file
|
||||
func (s *Storage) HasSection(section string) bool {
|
||||
s.check()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
s._check()
|
||||
_, err := s.gc.GetSection(section)
|
||||
return err == nil
|
||||
}
|
||||
@@ -193,26 +198,38 @@ func (s *Storage) HasSection(section string) bool {
|
||||
// DeleteSection removes the named section and all config from the
|
||||
// config file
|
||||
func (s *Storage) DeleteSection(section string) {
|
||||
s.check()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
s._check()
|
||||
s.gc.DeleteSection(section)
|
||||
}
|
||||
|
||||
// GetSectionList returns a slice of strings with names for all the
|
||||
// sections
|
||||
func (s *Storage) GetSectionList() []string {
|
||||
s.check()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
s._check()
|
||||
return s.gc.GetSectionList()
|
||||
}
|
||||
|
||||
// GetKeyList returns the keys in this section
|
||||
func (s *Storage) GetKeyList(section string) []string {
|
||||
s.check()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
s._check()
|
||||
return s.gc.GetKeyList(section)
|
||||
}
|
||||
|
||||
// GetValue returns the key in section with a found flag
|
||||
func (s *Storage) GetValue(section string, key string) (value string, found bool) {
|
||||
s.check()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
s._check()
|
||||
value, err := s.gc.GetValue(section, key)
|
||||
if err != nil {
|
||||
return "", false
|
||||
@@ -222,7 +239,10 @@ func (s *Storage) GetValue(section string, key string) (value string, found bool
|
||||
|
||||
// SetValue sets the value under key in section
|
||||
func (s *Storage) SetValue(section string, key string, value string) {
|
||||
s.check()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
s._check()
|
||||
if strings.HasPrefix(section, ":") {
|
||||
fs.Logf(nil, "Can't save config %q for on the fly backend %q", key, section)
|
||||
return
|
||||
@@ -232,7 +252,10 @@ func (s *Storage) SetValue(section string, key string, value string) {
|
||||
|
||||
// DeleteKey removes the key under section
|
||||
func (s *Storage) DeleteKey(section string, key string) bool {
|
||||
s.check()
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
s._check()
|
||||
return s.gc.DeleteKey(section, key)
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,6 @@ func AddFlags(ci *fs.ConfigInfo, flagSet *pflag.FlagSet) {
|
||||
flags.DurationVarP(flagSet, &ci.KvLockTime, "kv-lock-time", "", ci.KvLockTime, "Maximum time to keep key-value database locked by process")
|
||||
flags.BoolVarP(flagSet, &ci.DisableHTTPKeepAlives, "disable-http-keep-alives", "", ci.DisableHTTPKeepAlives, "Disable HTTP keep-alives and use each connection once.")
|
||||
flags.BoolVarP(flagSet, &ci.Metadata, "metadata", "M", ci.Metadata, "If set, preserve metadata when copying objects")
|
||||
flags.BoolVarP(flagSet, &ci.ServerSideAcrossConfigs, "server-side-across-configs", "", ci.ServerSideAcrossConfigs, "Allow server-side operations (e.g. copy) to work across different configs")
|
||||
}
|
||||
|
||||
// ParseHeaders converts the strings passed in via the header flags into HTTPOptions
|
||||
|
||||
+184
-50
@@ -2,11 +2,14 @@
|
||||
package filter
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -19,19 +22,80 @@ import (
|
||||
// This is accessed through GetConfig and AddConfig
|
||||
var globalConfig = mustNewFilter(nil)
|
||||
|
||||
// rule is one filter rule
|
||||
type rule struct {
|
||||
Include bool
|
||||
Regexp *regexp.Regexp
|
||||
}
|
||||
|
||||
// Match returns true if rule matches path
|
||||
func (r *rule) Match(path string) bool {
|
||||
return r.Regexp.MatchString(path)
|
||||
}
|
||||
|
||||
// String the rule
|
||||
func (r *rule) String() string {
|
||||
c := "-"
|
||||
if r.Include {
|
||||
c = "+"
|
||||
}
|
||||
return fmt.Sprintf("%s %s", c, r.Regexp.String())
|
||||
}
|
||||
|
||||
// rules is a slice of rules
|
||||
type rules struct {
|
||||
rules []rule
|
||||
existing map[string]struct{}
|
||||
}
|
||||
|
||||
// add adds a rule if it doesn't exist already
|
||||
func (rs *rules) add(Include bool, re *regexp.Regexp) {
|
||||
if rs.existing == nil {
|
||||
rs.existing = make(map[string]struct{})
|
||||
}
|
||||
newRule := rule{
|
||||
Include: Include,
|
||||
Regexp: re,
|
||||
}
|
||||
newRuleString := newRule.String()
|
||||
if _, ok := rs.existing[newRuleString]; ok {
|
||||
return // rule already exists
|
||||
}
|
||||
rs.rules = append(rs.rules, newRule)
|
||||
rs.existing[newRuleString] = struct{}{}
|
||||
}
|
||||
|
||||
// clear clears all the rules
|
||||
func (rs *rules) clear() {
|
||||
rs.rules = nil
|
||||
rs.existing = nil
|
||||
}
|
||||
|
||||
// len returns the number of rules
|
||||
func (rs *rules) len() int {
|
||||
return len(rs.rules)
|
||||
}
|
||||
|
||||
// FilesMap describes the map of files to transfer
|
||||
type FilesMap map[string]struct{}
|
||||
|
||||
// Opt configures the filter
|
||||
type Opt struct {
|
||||
DeleteExcluded bool
|
||||
RulesOpt
|
||||
ExcludeFile []string
|
||||
MetaRules RulesOpt
|
||||
FilesFrom []string
|
||||
FilesFromRaw []string
|
||||
MinAge fs.Duration
|
||||
MaxAge fs.Duration
|
||||
MinSize fs.SizeSuffix
|
||||
MaxSize fs.SizeSuffix
|
||||
IgnoreCase bool
|
||||
FilterRule []string
|
||||
FilterFrom []string
|
||||
ExcludeRule []string
|
||||
ExcludeFrom []string
|
||||
ExcludeFile []string
|
||||
IncludeRule []string
|
||||
IncludeFrom []string
|
||||
FilesFrom []string
|
||||
FilesFromRaw []string
|
||||
MinAge fs.Duration
|
||||
MaxAge fs.Duration
|
||||
MinSize fs.SizeSuffix
|
||||
MaxSize fs.SizeSuffix
|
||||
IgnoreCase bool
|
||||
}
|
||||
|
||||
// DefaultOpt is the default config for the filter
|
||||
@@ -42,9 +106,6 @@ var DefaultOpt = Opt{
|
||||
MaxSize: fs.SizeSuffix(-1),
|
||||
}
|
||||
|
||||
// FilesMap describes the map of files to transfer
|
||||
type FilesMap map[string]struct{}
|
||||
|
||||
// Filter describes any filtering in operation
|
||||
type Filter struct {
|
||||
Opt Opt
|
||||
@@ -52,7 +113,6 @@ type Filter struct {
|
||||
ModTimeTo time.Time
|
||||
fileRules rules
|
||||
dirRules rules
|
||||
metaRules rules
|
||||
files FilesMap // files if filesFrom
|
||||
dirs FilesMap // dirs from filesFrom
|
||||
}
|
||||
@@ -82,14 +142,57 @@ func NewFilter(opt *Opt) (f *Filter, err error) {
|
||||
fs.Debugf(nil, "--max-age %v to %v", f.Opt.MaxAge, f.ModTimeFrom)
|
||||
}
|
||||
|
||||
err = parseRules(&f.Opt.RulesOpt, f.Add, f.Clear)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
addImplicitExclude := false
|
||||
foundExcludeRule := false
|
||||
|
||||
for _, rule := range f.Opt.IncludeRule {
|
||||
err = f.Add(true, rule)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
addImplicitExclude = true
|
||||
}
|
||||
for _, rule := range f.Opt.IncludeFrom {
|
||||
err := forEachLine(rule, false, func(line string) error {
|
||||
return f.Add(true, line)
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
addImplicitExclude = true
|
||||
}
|
||||
for _, rule := range f.Opt.ExcludeRule {
|
||||
err = f.Add(false, rule)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
foundExcludeRule = true
|
||||
}
|
||||
for _, rule := range f.Opt.ExcludeFrom {
|
||||
err := forEachLine(rule, false, func(line string) error {
|
||||
return f.Add(false, line)
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
foundExcludeRule = true
|
||||
}
|
||||
|
||||
err = parseRules(&f.Opt.MetaRules, f.metaRules.Add, f.metaRules.clear)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if addImplicitExclude && foundExcludeRule {
|
||||
fs.Errorf(nil, "Using --filter is recommended instead of both --include and --exclude as the order they are parsed in is indeterminate")
|
||||
}
|
||||
|
||||
for _, rule := range f.Opt.FilterRule {
|
||||
err = f.AddRule(rule)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
for _, rule := range f.Opt.FilterFrom {
|
||||
err := forEachLine(rule, false, f.AddRule)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
inActive := f.InActive()
|
||||
@@ -122,6 +225,12 @@ func NewFilter(opt *Opt) (f *Filter, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
if addImplicitExclude {
|
||||
err = f.Add(false, "/**")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if fs.GetConfig(context.Background()).Dump&fs.DumpFilters != 0 {
|
||||
fmt.Println("--- start filters ---")
|
||||
fmt.Println(f.DumpFilters())
|
||||
@@ -200,7 +309,16 @@ func (f *Filter) Add(Include bool, glob string) error {
|
||||
//
|
||||
// Line comments may be introduced with '#' or ';'
|
||||
func (f *Filter) AddRule(rule string) error {
|
||||
return addRule(rule, f.Add, f.Clear)
|
||||
switch {
|
||||
case rule == "!":
|
||||
f.Clear()
|
||||
return nil
|
||||
case strings.HasPrefix(rule, "- "):
|
||||
return f.Add(false, rule[2:])
|
||||
case strings.HasPrefix(rule, "+ "):
|
||||
return f.Add(true, rule[2:])
|
||||
}
|
||||
return fmt.Errorf("malformed rule %q", rule)
|
||||
}
|
||||
|
||||
// initAddFile creates f.files and f.dirs
|
||||
@@ -241,7 +359,6 @@ func (f *Filter) Files() FilesMap {
|
||||
func (f *Filter) Clear() {
|
||||
f.fileRules.clear()
|
||||
f.dirRules.clear()
|
||||
f.metaRules.clear()
|
||||
}
|
||||
|
||||
// InActive returns false if any filters are active
|
||||
@@ -253,13 +370,17 @@ func (f *Filter) InActive() bool {
|
||||
f.Opt.MaxSize < 0 &&
|
||||
f.fileRules.len() == 0 &&
|
||||
f.dirRules.len() == 0 &&
|
||||
f.metaRules.len() == 0 &&
|
||||
len(f.Opt.ExcludeFile) == 0)
|
||||
}
|
||||
|
||||
// IncludeRemote returns whether this remote passes the filter rules.
|
||||
func (f *Filter) IncludeRemote(remote string) bool {
|
||||
return f.fileRules.include(remote)
|
||||
for _, rule := range f.fileRules.rules {
|
||||
if rule.Match(remote) {
|
||||
return rule.Include
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// ListContainsExcludeFile checks if exclude file is present in the list.
|
||||
@@ -302,7 +423,13 @@ func (f *Filter) IncludeDirectory(ctx context.Context, fs fs.Fs) func(string) (b
|
||||
return include, nil
|
||||
}
|
||||
remote += "/"
|
||||
return f.dirRules.include(remote), nil
|
||||
for _, rule := range f.dirRules.rules {
|
||||
if rule.Match(remote) {
|
||||
return rule.Include, nil
|
||||
}
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +453,7 @@ func (f *Filter) DirContainsExcludeFile(ctx context.Context, fremote fs.Fs, remo
|
||||
|
||||
// Include returns whether this object should be included into the
|
||||
// sync or not
|
||||
func (f *Filter) Include(remote string, size int64, modTime time.Time, metadata fs.Metadata) bool {
|
||||
func (f *Filter) Include(remote string, size int64, modTime time.Time) bool {
|
||||
// filesFrom takes precedence
|
||||
if f.files != nil {
|
||||
_, include := f.files[remote]
|
||||
@@ -344,15 +471,6 @@ func (f *Filter) Include(remote string, size int64, modTime time.Time, metadata
|
||||
if f.Opt.MaxSize >= 0 && size > int64(f.Opt.MaxSize) {
|
||||
return false
|
||||
}
|
||||
if f.metaRules.len() > 0 && len(metadata) > 0 {
|
||||
metadatas := make([]string, 0, len(metadata))
|
||||
for key, value := range metadata {
|
||||
metadatas = append(metadatas, fmt.Sprintf("%s=%s", key, value))
|
||||
}
|
||||
if !f.metaRules.includeMany(metadatas) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return f.IncludeRemote(remote)
|
||||
}
|
||||
|
||||
@@ -367,17 +485,39 @@ func (f *Filter) IncludeObject(ctx context.Context, o fs.Object) bool {
|
||||
} else {
|
||||
modTime = time.Unix(0, 0)
|
||||
}
|
||||
var metadata fs.Metadata
|
||||
if f.metaRules.len() > 0 {
|
||||
var err error
|
||||
metadata, err = fs.GetMetadata(ctx, o)
|
||||
if err != nil {
|
||||
fs.Errorf(o, "Failed to read metadata: %v", err)
|
||||
metadata = nil
|
||||
}
|
||||
|
||||
return f.Include(o.Remote(), o.Size(), modTime)
|
||||
}
|
||||
|
||||
// forEachLine calls fn on every line in the file pointed to by path
|
||||
//
|
||||
// It ignores empty lines and lines starting with '#' or ';' if raw is false
|
||||
func forEachLine(path string, raw bool, fn func(string) error) (err error) {
|
||||
var scanner *bufio.Scanner
|
||||
if path == "-" {
|
||||
scanner = bufio.NewScanner(os.Stdin)
|
||||
} else {
|
||||
in, err := os.Open(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
scanner = bufio.NewScanner(in)
|
||||
defer fs.CheckClose(in, &err)
|
||||
}
|
||||
return f.Include(o.Remote(), o.Size(), modTime, metadata)
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
if !raw {
|
||||
line = strings.TrimSpace(line)
|
||||
if len(line) == 0 || line[0] == '#' || line[0] == ';' {
|
||||
continue
|
||||
}
|
||||
}
|
||||
err := fn(line)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return scanner.Err()
|
||||
}
|
||||
|
||||
// DumpFilters dumps the filters in textual form, 1 per line
|
||||
@@ -397,12 +537,6 @@ func (f *Filter) DumpFilters() string {
|
||||
for _, dirRule := range f.dirRules.rules {
|
||||
rules = append(rules, dirRule.String())
|
||||
}
|
||||
if f.metaRules.len() > 0 {
|
||||
rules = append(rules, "--- Metadata filter rules ---")
|
||||
for _, metaRule := range f.metaRules.rules {
|
||||
rules = append(rules, metaRule.String())
|
||||
}
|
||||
}
|
||||
return strings.Join(rules, "\n")
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ type includeTest struct {
|
||||
|
||||
func testInclude(t *testing.T, f *Filter, tests []includeTest) {
|
||||
for _, test := range tests {
|
||||
got := f.Include(test.in, test.size, time.Unix(test.modTime, 0), nil)
|
||||
got := f.Include(test.in, test.size, time.Unix(test.modTime, 0))
|
||||
assert.Equal(t, test.want, got, fmt.Sprintf("in=%q, size=%v, modTime=%v", test.in, test.size, time.Unix(test.modTime, 0)))
|
||||
}
|
||||
}
|
||||
@@ -714,7 +714,7 @@ func TestFilterMatchesFromDocs(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
err = f.Add(false, "*")
|
||||
require.NoError(t, err)
|
||||
included := f.Include(test.file, 0, time.Unix(0, 0), nil)
|
||||
included := f.Include(test.file, 0, time.Unix(0, 0))
|
||||
if included != test.included {
|
||||
t.Errorf("%q match %q: want %v got %v", test.glob, test.file, test.included, included)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package filterflags
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/rclone/rclone/fs/config/flags"
|
||||
"github.com/rclone/rclone/fs/filter"
|
||||
@@ -27,27 +26,17 @@ func Reload(ctx context.Context) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddRuleFlags add a set of rules flags with prefix
|
||||
func AddRuleFlags(flagSet *pflag.FlagSet, Opt *filter.RulesOpt, what, prefix string) {
|
||||
shortFilter := ""
|
||||
if prefix == "" {
|
||||
shortFilter = "f"
|
||||
}
|
||||
flags.StringArrayVarP(flagSet, &Opt.FilterRule, prefix+"filter", shortFilter, nil, fmt.Sprintf("Add a %s filtering rule", what))
|
||||
flags.StringArrayVarP(flagSet, &Opt.FilterFrom, prefix+"filter-from", "", nil, fmt.Sprintf("Read %s filtering patterns from a file (use - to read from stdin)", what))
|
||||
flags.StringArrayVarP(flagSet, &Opt.ExcludeRule, prefix+"exclude", "", nil, fmt.Sprintf("Exclude %ss matching pattern", what))
|
||||
flags.StringArrayVarP(flagSet, &Opt.ExcludeFrom, prefix+"exclude-from", "", nil, fmt.Sprintf("Read %s exclude patterns from file (use - to read from stdin)", what))
|
||||
flags.StringArrayVarP(flagSet, &Opt.IncludeRule, prefix+"include", "", nil, fmt.Sprintf("Include %ss matching pattern", what))
|
||||
flags.StringArrayVarP(flagSet, &Opt.IncludeFrom, prefix+"include-from", "", nil, fmt.Sprintf("Read %s include patterns from file (use - to read from stdin)", what))
|
||||
}
|
||||
|
||||
// AddFlags adds the non filing system specific flags to the command
|
||||
func AddFlags(flagSet *pflag.FlagSet) {
|
||||
rc.AddOptionReload("filter", &Opt, Reload)
|
||||
flags.BoolVarP(flagSet, &Opt.DeleteExcluded, "delete-excluded", "", false, "Delete files on dest excluded from sync")
|
||||
AddRuleFlags(flagSet, &Opt.RulesOpt, "file", "")
|
||||
AddRuleFlags(flagSet, &Opt.MetaRules, "metadata", "metadata-")
|
||||
flags.StringArrayVarP(flagSet, &Opt.FilterRule, "filter", "f", nil, "Add a file-filtering rule")
|
||||
flags.StringArrayVarP(flagSet, &Opt.FilterFrom, "filter-from", "", nil, "Read filtering patterns from a file (use - to read from stdin)")
|
||||
flags.StringArrayVarP(flagSet, &Opt.ExcludeRule, "exclude", "", nil, "Exclude files matching pattern")
|
||||
flags.StringArrayVarP(flagSet, &Opt.ExcludeFrom, "exclude-from", "", nil, "Read exclude patterns from file (use - to read from stdin)")
|
||||
flags.StringArrayVarP(flagSet, &Opt.ExcludeFile, "exclude-if-present", "", nil, "Exclude directories if filename is present")
|
||||
flags.StringArrayVarP(flagSet, &Opt.IncludeRule, "include", "", nil, "Include files matching pattern")
|
||||
flags.StringArrayVarP(flagSet, &Opt.IncludeFrom, "include-from", "", nil, "Read include patterns from file (use - to read from stdin)")
|
||||
flags.StringArrayVarP(flagSet, &Opt.FilesFrom, "files-from", "", nil, "Read list of source-file names from file (use - to read from stdin)")
|
||||
flags.StringArrayVarP(flagSet, &Opt.FilesFromRaw, "files-from-raw", "", nil, "Read list of source-file names from file without any processing of lines (use - to read from stdin)")
|
||||
flags.FVarP(flagSet, &Opt.MinAge, "min-age", "", "Only transfer files older than this in s or suffix ms|s|m|h|d|w|M|y")
|
||||
|
||||
@@ -1,253 +0,0 @@
|
||||
package filter
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
)
|
||||
|
||||
// RulesOpt is configuration for a rule set
|
||||
type RulesOpt struct {
|
||||
FilterRule []string
|
||||
FilterFrom []string
|
||||
ExcludeRule []string
|
||||
ExcludeFrom []string
|
||||
IncludeRule []string
|
||||
IncludeFrom []string
|
||||
}
|
||||
|
||||
// rule is one filter rule
|
||||
type rule struct {
|
||||
Include bool
|
||||
Regexp *regexp.Regexp
|
||||
}
|
||||
|
||||
// Match returns true if rule matches path
|
||||
func (r *rule) Match(path string) bool {
|
||||
return r.Regexp.MatchString(path)
|
||||
}
|
||||
|
||||
// String the rule
|
||||
func (r *rule) String() string {
|
||||
c := "-"
|
||||
if r.Include {
|
||||
c = "+"
|
||||
}
|
||||
return fmt.Sprintf("%s %s", c, r.Regexp.String())
|
||||
}
|
||||
|
||||
// rules is a slice of rules
|
||||
type rules struct {
|
||||
rules []rule
|
||||
existing map[string]struct{}
|
||||
}
|
||||
|
||||
type addFn func(Include bool, glob string) error
|
||||
|
||||
// add adds a rule if it doesn't exist already
|
||||
func (rs *rules) add(Include bool, re *regexp.Regexp) {
|
||||
if rs.existing == nil {
|
||||
rs.existing = make(map[string]struct{})
|
||||
}
|
||||
newRule := rule{
|
||||
Include: Include,
|
||||
Regexp: re,
|
||||
}
|
||||
newRuleString := newRule.String()
|
||||
if _, ok := rs.existing[newRuleString]; ok {
|
||||
return // rule already exists
|
||||
}
|
||||
rs.rules = append(rs.rules, newRule)
|
||||
rs.existing[newRuleString] = struct{}{}
|
||||
}
|
||||
|
||||
// Add adds a filter rule with include or exclude status indicated
|
||||
func (rs *rules) Add(Include bool, glob string) error {
|
||||
re, err := GlobToRegexp(glob, false /* f.Opt.IgnoreCase */)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
rs.add(Include, re)
|
||||
return nil
|
||||
}
|
||||
|
||||
type clearFn func()
|
||||
|
||||
// clear clears all the rules
|
||||
func (rs *rules) clear() {
|
||||
rs.rules = nil
|
||||
rs.existing = nil
|
||||
}
|
||||
|
||||
// len returns the number of rules
|
||||
func (rs *rules) len() int {
|
||||
return len(rs.rules)
|
||||
}
|
||||
|
||||
// include returns whether this remote passes the filter rules.
|
||||
func (rs *rules) include(remote string) bool {
|
||||
for _, rule := range rs.rules {
|
||||
if rule.Match(remote) {
|
||||
return rule.Include
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// include returns whether this collection of strings remote passes
|
||||
// the filter rules.
|
||||
//
|
||||
// the first rule is evaluated on all the remotes and if it matches
|
||||
// then the result is returned. If not the next rule is tested and so
|
||||
// on.
|
||||
func (rs *rules) includeMany(remotes []string) bool {
|
||||
for _, rule := range rs.rules {
|
||||
for _, remote := range remotes {
|
||||
if rule.Match(remote) {
|
||||
return rule.Include
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// forEachLine calls fn on every line in the file pointed to by path
|
||||
//
|
||||
// It ignores empty lines and lines starting with '#' or ';' if raw is false
|
||||
func forEachLine(path string, raw bool, fn func(string) error) (err error) {
|
||||
var scanner *bufio.Scanner
|
||||
if path == "-" {
|
||||
scanner = bufio.NewScanner(os.Stdin)
|
||||
} else {
|
||||
in, err := os.Open(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
scanner = bufio.NewScanner(in)
|
||||
defer fs.CheckClose(in, &err)
|
||||
}
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
if !raw {
|
||||
line = strings.TrimSpace(line)
|
||||
if len(line) == 0 || line[0] == '#' || line[0] == ';' {
|
||||
continue
|
||||
}
|
||||
}
|
||||
err := fn(line)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return scanner.Err()
|
||||
}
|
||||
|
||||
// AddRule adds a filter rule with include/exclude indicated by the prefix
|
||||
//
|
||||
// These are
|
||||
//
|
||||
// + glob
|
||||
// - glob
|
||||
// !
|
||||
//
|
||||
// '+' includes the glob, '-' excludes it and '!' resets the filter list
|
||||
//
|
||||
// Line comments may be introduced with '#' or ';'
|
||||
func addRule(rule string, add addFn, clear clearFn) error {
|
||||
switch {
|
||||
case rule == "!":
|
||||
clear()
|
||||
return nil
|
||||
case strings.HasPrefix(rule, "- "):
|
||||
return add(false, rule[2:])
|
||||
case strings.HasPrefix(rule, "+ "):
|
||||
return add(true, rule[2:])
|
||||
}
|
||||
return fmt.Errorf("malformed rule %q", rule)
|
||||
}
|
||||
|
||||
// AddRule adds a filter rule with include/exclude indicated by the prefix
|
||||
//
|
||||
// These are
|
||||
//
|
||||
// + glob
|
||||
// - glob
|
||||
// !
|
||||
//
|
||||
// '+' includes the glob, '-' excludes it and '!' resets the filter list
|
||||
//
|
||||
// Line comments may be introduced with '#' or ';'
|
||||
func (rs *rules) AddRule(rule string) error {
|
||||
return addRule(rule, rs.Add, rs.clear)
|
||||
}
|
||||
|
||||
// Parse the rules passed in and add them to the function
|
||||
func parseRules(opt *RulesOpt, add addFn, clear clearFn) (err error) {
|
||||
addImplicitExclude := false
|
||||
foundExcludeRule := false
|
||||
|
||||
for _, rule := range opt.IncludeRule {
|
||||
err = add(true, rule)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
addImplicitExclude = true
|
||||
}
|
||||
for _, rule := range opt.IncludeFrom {
|
||||
err := forEachLine(rule, false, func(line string) error {
|
||||
return add(true, line)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
addImplicitExclude = true
|
||||
}
|
||||
for _, rule := range opt.ExcludeRule {
|
||||
err = add(false, rule)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
foundExcludeRule = true
|
||||
}
|
||||
for _, rule := range opt.ExcludeFrom {
|
||||
err := forEachLine(rule, false, func(line string) error {
|
||||
return add(false, line)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
foundExcludeRule = true
|
||||
}
|
||||
|
||||
if addImplicitExclude && foundExcludeRule {
|
||||
fs.Errorf(nil, "Using --filter is recommended instead of both --include and --exclude as the order they are parsed in is indeterminate")
|
||||
}
|
||||
|
||||
for _, rule := range opt.FilterRule {
|
||||
err = addRule(rule, add, clear)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
for _, rule := range opt.FilterFrom {
|
||||
err := forEachLine(rule, false, func(rule string) error {
|
||||
return addRule(rule, add, clear)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if addImplicitExclude {
|
||||
err = add(false, "/**")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -424,7 +424,7 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
|
||||
return nil, accounting.ErrorMaxTransferLimitReachedGraceful
|
||||
}
|
||||
}
|
||||
if doCopy := f.Features().Copy; doCopy != nil && (SameConfig(src.Fs(), f) || (SameRemoteType(src.Fs(), f) && (f.Features().ServerSideAcrossConfigs || ci.ServerSideAcrossConfigs))) {
|
||||
if doCopy := f.Features().Copy; doCopy != nil && (SameConfig(src.Fs(), f) || (SameRemoteType(src.Fs(), f) && f.Features().ServerSideAcrossConfigs)) {
|
||||
in := tr.Account(ctx, nil) // account the transfer
|
||||
in.ServerSideCopyStart()
|
||||
newDst, err = doCopy(ctx, src, remote)
|
||||
@@ -604,7 +604,6 @@ func SameObject(src, dst fs.Object) bool {
|
||||
// It returns the destination object if possible. Note that this may
|
||||
// be nil.
|
||||
func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.Object) (newDst fs.Object, err error) {
|
||||
ci := fs.GetConfig(ctx)
|
||||
tr := accounting.Stats(ctx).NewCheckingTransfer(src)
|
||||
defer func() {
|
||||
if err == nil {
|
||||
@@ -619,7 +618,7 @@ func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs.
|
||||
return newDst, nil
|
||||
}
|
||||
// See if we have Move available
|
||||
if doMove := fdst.Features().Move; doMove != nil && (SameConfig(src.Fs(), fdst) || (SameRemoteType(src.Fs(), fdst) && (fdst.Features().ServerSideAcrossConfigs || ci.ServerSideAcrossConfigs))) {
|
||||
if doMove := fdst.Features().Move; doMove != nil && (SameConfig(src.Fs(), fdst) || (SameRemoteType(src.Fs(), fdst) && fdst.Features().ServerSideAcrossConfigs)) {
|
||||
// Delete destination if it exists and is not the same file as src (could be same file while seemingly different if the remote is case insensitive)
|
||||
if dst != nil && !SameObject(src, dst) {
|
||||
err = DeleteFile(ctx, dst)
|
||||
@@ -1515,7 +1514,7 @@ func Rmdirs(ctx context.Context, f fs.Fs, dir string, leaveRoot bool) error {
|
||||
dir := toDelete[i]
|
||||
// If a filter matches the directory then that
|
||||
// directory is a candidate for deletion
|
||||
if !fi.IncludeRemote(dir + "/") {
|
||||
if !fi.Include(dir+"/", 0, time.Now()) {
|
||||
continue
|
||||
}
|
||||
err = TryRmdir(ctx, f, dir)
|
||||
@@ -1952,17 +1951,11 @@ func moveOrCopyFile(ctx context.Context, fdst fs.Fs, fsrc fs.Fs, dstFileName str
|
||||
return err
|
||||
}
|
||||
}
|
||||
needTransfer := NeedTransfer(ctx, dstObj, srcObj)
|
||||
if needTransfer {
|
||||
NoNeedTransfer, err := CompareOrCopyDest(ctx, fdst, dstObj, srcObj, copyDestDir, backupDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if NoNeedTransfer {
|
||||
needTransfer = false
|
||||
}
|
||||
NoNeedTransfer, err := CompareOrCopyDest(ctx, fdst, dstObj, srcObj, copyDestDir, backupDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if needTransfer {
|
||||
if !NoNeedTransfer && NeedTransfer(ctx, dstObj, srcObj) {
|
||||
// If destination already exists, then we must move it into --backup-dir if required
|
||||
if dstObj != nil && backupDir != nil {
|
||||
err = MoveBackupDir(ctx, backupDir, dstObj)
|
||||
|
||||
+2
-2
@@ -126,7 +126,7 @@ func parseDurationFromNow(age string, getNow func() time.Time) (d time.Duration,
|
||||
|
||||
// ParseDuration parses a duration string. Accept ms|s|m|h|d|w|M|y suffixes. Defaults to second if not provided
|
||||
func ParseDuration(age string) (time.Duration, error) {
|
||||
return parseDurationFromNow(age, time.Now)
|
||||
return parseDurationFromNow(age, timeNowFunc)
|
||||
}
|
||||
|
||||
// ReadableString parses d into a human-readable duration.
|
||||
@@ -216,7 +216,7 @@ func (d *Duration) UnmarshalJSON(in []byte) error {
|
||||
|
||||
// Scan implements the fmt.Scanner interface
|
||||
func (d *Duration) Scan(s fmt.ScanState, ch rune) error {
|
||||
token, err := s.Token(true, nil)
|
||||
token, err := s.Token(true, func(rune) bool { return true })
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -145,11 +145,28 @@ func TestDurationReadableString(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDurationScan(t *testing.T) {
|
||||
var v Duration
|
||||
n, err := fmt.Sscan(" 17m ", &v)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 1, n)
|
||||
assert.Equal(t, Duration(17*60*time.Second), v)
|
||||
now := time.Date(2020, 9, 5, 8, 15, 5, 250, time.UTC)
|
||||
oldTimeNowFunc := timeNowFunc
|
||||
timeNowFunc = func() time.Time { return now }
|
||||
defer func() { timeNowFunc = oldTimeNowFunc }()
|
||||
|
||||
for _, test := range []struct {
|
||||
in string
|
||||
want Duration
|
||||
}{
|
||||
{"17m", Duration(17 * time.Minute)},
|
||||
{"-12h", Duration(-12 * time.Hour)},
|
||||
{"0", Duration(0)},
|
||||
{"off", DurationOff},
|
||||
{"2022-03-26T17:48:19Z", Duration(now.Sub(time.Date(2022, 03, 26, 17, 48, 19, 0, time.UTC)))},
|
||||
{"2022-03-26 17:48:19", Duration(now.Sub(time.Date(2022, 03, 26, 17, 48, 19, 0, time.Local)))},
|
||||
} {
|
||||
var got Duration
|
||||
n, err := fmt.Sscan(test.in, &got)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 1, n)
|
||||
assert.Equal(t, test.want, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseUnmarshalJSON(t *testing.T) {
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ func (t *Time) UnmarshalJSON(in []byte) error {
|
||||
|
||||
// Scan implements the fmt.Scanner interface
|
||||
func (t *Time) Scan(s fmt.ScanState, ch rune) error {
|
||||
token, err := s.Token(true, nil)
|
||||
token, err := s.Token(true, func(rune) bool { return true })
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+17
-9
@@ -93,15 +93,23 @@ func TestTimeScan(t *testing.T) {
|
||||
timeNowFunc = func() time.Time { return now }
|
||||
defer func() { timeNowFunc = oldTimeNowFunc }()
|
||||
|
||||
var v1, v2, v3, v4, v5 Time
|
||||
n, err := fmt.Sscan(" 17m -12h 0 off 2022-03-26T17:48:19Z ", &v1, &v2, &v3, &v4, &v5)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 5, n)
|
||||
assert.Equal(t, Time(now.Add(-17*time.Minute)), v1)
|
||||
assert.Equal(t, Time(now.Add(12*time.Hour)), v2)
|
||||
assert.Equal(t, Time(now), v3)
|
||||
assert.Equal(t, Time(time.Time{}), v4)
|
||||
assert.Equal(t, Time(time.Date(2022, 03, 26, 17, 48, 19, 0, time.UTC)), v5)
|
||||
for _, test := range []struct {
|
||||
in string
|
||||
want Time
|
||||
}{
|
||||
{"17m", Time(now.Add(-17 * time.Minute))},
|
||||
{"-12h", Time(now.Add(12 * time.Hour))},
|
||||
{"0", Time(now)},
|
||||
{"off", Time(time.Time{})},
|
||||
{"2022-03-26T17:48:19Z", Time(time.Date(2022, 03, 26, 17, 48, 19, 0, time.UTC))},
|
||||
{"2022-03-26 17:48:19", Time(time.Date(2022, 03, 26, 17, 48, 19, 0, time.Local))},
|
||||
} {
|
||||
var got Time
|
||||
n, err := fmt.Sscan(test.in, &got)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 1, n)
|
||||
assert.Equal(t, test.want, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseTimeUnmarshalJSON(t *testing.T) {
|
||||
|
||||
@@ -406,34 +406,3 @@ func rcJobStop(ctx context.Context, in rc.Params) (out rc.Params, err error) {
|
||||
job.Stop()
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
rc.Add(rc.Call{
|
||||
Path: "job/stopgroup",
|
||||
Fn: rcGroupStop,
|
||||
Title: "Stop all running jobs in a group",
|
||||
Help: `Parameters:
|
||||
|
||||
- group - name of the group (string).
|
||||
`,
|
||||
})
|
||||
}
|
||||
|
||||
// Stops all running jobs in a group
|
||||
func rcGroupStop(ctx context.Context, in rc.Params) (out rc.Params, err error) {
|
||||
group, err := in.GetString("group")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
running.mu.RLock()
|
||||
defer running.mu.RUnlock()
|
||||
for _, job := range running.jobs {
|
||||
if job.Group == group {
|
||||
job.mu.Lock()
|
||||
job.Stop()
|
||||
job.mu.Unlock()
|
||||
}
|
||||
}
|
||||
out = make(rc.Params)
|
||||
return out, nil
|
||||
}
|
||||
@@ -452,48 +452,6 @@ func TestRcSyncJobStop(t *testing.T) {
|
||||
assert.Equal(t, false, out["success"])
|
||||
}
|
||||
|
||||
func TestRcJobStopGroup(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
jobID = 0
|
||||
_, _, err := NewJob(ctx, ctxFn, rc.Params{
|
||||
"_async": true,
|
||||
"_group": "myparty",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
_, _, err = NewJob(ctx, ctxFn, rc.Params{
|
||||
"_async": true,
|
||||
"_group": "myparty",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
call := rc.Calls.Get("job/stopgroup")
|
||||
assert.NotNil(t, call)
|
||||
in := rc.Params{"group": "myparty"}
|
||||
out, err := call.Fn(context.Background(), in)
|
||||
require.NoError(t, err)
|
||||
require.Empty(t, out)
|
||||
|
||||
in = rc.Params{}
|
||||
_, err = call.Fn(context.Background(), in)
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), "Didn't find key")
|
||||
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
|
||||
call = rc.Calls.Get("job/status")
|
||||
assert.NotNil(t, call)
|
||||
for i := 1; i <= 2; i++ {
|
||||
in = rc.Params{"jobid": i}
|
||||
out, err = call.Fn(context.Background(), in)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, out)
|
||||
assert.Equal(t, "myparty", out["group"])
|
||||
assert.Equal(t, "context canceled", out["error"])
|
||||
assert.Equal(t, true, out["finished"])
|
||||
assert.Equal(t, false, out["success"])
|
||||
}
|
||||
}
|
||||
|
||||
func TestOnFinish(t *testing.T) {
|
||||
jobID = 0
|
||||
done := make(chan struct{})
|
||||
|
||||
+4
-10
@@ -331,17 +331,11 @@ func (s *syncCopyMove) pairChecker(in *pipe, out *pipe, fraction int, wg *sync.W
|
||||
tr := accounting.Stats(s.ctx).NewCheckingTransfer(src)
|
||||
// Check to see if can store this
|
||||
if src.Storable() {
|
||||
needTransfer := operations.NeedTransfer(s.ctx, pair.Dst, pair.Src)
|
||||
if needTransfer {
|
||||
NoNeedTransfer, err := operations.CompareOrCopyDest(s.ctx, s.fdst, pair.Dst, pair.Src, s.compareCopyDest, s.backupDir)
|
||||
if err != nil {
|
||||
s.processError(err)
|
||||
}
|
||||
if NoNeedTransfer {
|
||||
needTransfer = false
|
||||
}
|
||||
NoNeedTransfer, err := operations.CompareOrCopyDest(s.ctx, s.fdst, pair.Dst, pair.Src, s.compareCopyDest, s.backupDir)
|
||||
if err != nil {
|
||||
s.processError(err)
|
||||
}
|
||||
if needTransfer {
|
||||
if !NoNeedTransfer && operations.NeedTransfer(s.ctx, pair.Dst, pair.Src) {
|
||||
// If files are treated as immutable, fail if destination exists and does not match
|
||||
if s.ci.Immutable && pair.Dst != nil {
|
||||
err := fs.CountError(fserrors.NoRetryError(fs.ErrorImmutableModified))
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
//go:build !go1.17
|
||||
// +build !go1.17
|
||||
//go:build !go1.16
|
||||
// +build !go1.16
|
||||
|
||||
package fs
|
||||
|
||||
// Upgrade to Go version 1.17 to compile rclone - latest stable go
|
||||
// Upgrade to Go version 1.16 to compile rclone - latest stable go
|
||||
// compiler recommended.
|
||||
func init() { Go_version_1_17_required_for_compilation() }
|
||||
func init() { Go_version_1_16_required_for_compilation() }
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package fs
|
||||
|
||||
// VersionTag of rclone
|
||||
var VersionTag = "v1.60.0"
|
||||
var VersionTag = "v1.59.2"
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/rclone/rclone
|
||||
|
||||
go 1.17
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
bazil.org/fuse v0.0.0-20200524192727-fb710f7dfd05
|
||||
@@ -70,63 +70,6 @@ require (
|
||||
storj.io/uplink v1.9.0
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/compute v1.6.1 // indirect
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
|
||||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
||||
github.com/anacrolix/log v0.10.1-0.20220126091220-5c1b6f3af59c // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/calebcase/tmpfile v1.0.3 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/gdamore/encoding v1.0.0 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.2 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
||||
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
||||
github.com/jcmturner/gofork v1.0.0 // indirect
|
||||
github.com/jcmturner/goidentity/v6 v6.0.1 // indirect
|
||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||
github.com/mattn/go-ieproxy v0.0.1 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
||||
github.com/onsi/gomega v1.13.0 // indirect
|
||||
github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.32.1 // indirect
|
||||
github.com/prometheus/procfs v0.7.3 // indirect
|
||||
github.com/rivo/uniseg v0.2.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/spacemonkeygo/monkit/v3 v3.0.17 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.10 // indirect
|
||||
github.com/tklauser/numcpus v0.4.0 // indirect
|
||||
github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
github.com/zeebo/errs v1.3.0 // indirect
|
||||
go.opencensus.io v0.23.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220602131408-e326c6e8e9c8 // indirect
|
||||
google.golang.org/grpc v1.47.0 // indirect
|
||||
google.golang.org/protobuf v1.28.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
storj.io/common v0.0.0-20220414110316-a5cb7172d6bf // indirect
|
||||
storj.io/drpc v0.0.30 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Microsoft/go-winio v0.5.1 // indirect
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20220623141421-5afb4c282135
|
||||
|
||||
@@ -591,8 +591,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
|
||||
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20200416171014-ffad7fcb44b8 h1:IGJQmLBLYBdAknj21W3JsVof0yjEXfy1Q0K3YZebDOg=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20200416171014-ffad7fcb44b8/go.mod h1:XWL4vDyd3JKmJx+hZWUVgCNmmhZ2dTBcaNDcxH465s0=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20220725095014-c4e0c2b5debf h1:Y43S3e9P1NPs/QF4R5/SdlXj2d31540hP4Gk8VKNvDg=
|
||||
github.com/t3rm1n4l/go-mega v0.0.0-20220725095014-c4e0c2b5debf/go.mod h1:c+cGNU1qi9bO7ZF4IRMYk+KaZTNiQ/gQrSbyMmGFq1Q=
|
||||
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
||||
|
||||
@@ -217,14 +217,6 @@ This needs expanding and submitting to pypi...
|
||||
|
||||
Rust bindings are available in the `librclone` crate: https://crates.io/crates/librclone
|
||||
|
||||
## PHP
|
||||
|
||||
The `php` subdirectory contains how to use the C library librclone in php through foreign
|
||||
function interface (FFI).
|
||||
|
||||
Useful docs:
|
||||
- [PHP / FFI](https://www.php.net/manual/en/book.ffi.php)
|
||||
|
||||
## TODO
|
||||
|
||||
- Async jobs must currently be cancelled manually at the moment - RcloneFinalize doesn't do it.
|
||||
|
||||
@@ -35,12 +35,12 @@ import (
|
||||
"github.com/rclone/rclone/librclone/librclone"
|
||||
|
||||
_ "github.com/rclone/rclone/backend/all" // import all backends
|
||||
_ "github.com/rclone/rclone/cmd/cmount" // import cmount
|
||||
_ "github.com/rclone/rclone/cmd/mount" // import mount
|
||||
_ "github.com/rclone/rclone/cmd/mount2" // import mount2
|
||||
_ "github.com/rclone/rclone/fs/operations" // import operations/* rc commands
|
||||
_ "github.com/rclone/rclone/fs/sync" // import sync/*
|
||||
_ "github.com/rclone/rclone/lib/plugin" // import plugins
|
||||
_ "github.com/rclone/rclone/cmd/mount" // import mount
|
||||
_ "github.com/rclone/rclone/cmd/mount2" // import mount2
|
||||
_ "github.com/rclone/rclone/cmd/cmount" // import cmount
|
||||
)
|
||||
|
||||
// RcloneInitialize initializes rclone as a library
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
PHP interface to librclone.so, using FFI ( Foreign Function Interface )
|
||||
|
||||
Create an rclone object
|
||||
|
||||
$rc = new Rclone( __DIR__ . '/librclone.so' );
|
||||
|
||||
Then call rpc calls on it
|
||||
|
||||
$rc->rpc( "config/listremotes", "{}" );
|
||||
|
||||
When finished, close it
|
||||
|
||||
$rc->close();
|
||||
*/
|
||||
|
||||
class Rclone {
|
||||
|
||||
protected $rclone;
|
||||
private $out;
|
||||
|
||||
public function __construct( $libshared )
|
||||
{
|
||||
$this->rclone = \FFI::cdef("
|
||||
struct RcloneRPCResult {
|
||||
char* Output;
|
||||
int Status;
|
||||
};
|
||||
extern void RcloneInitialize();
|
||||
extern void RcloneFinalize();
|
||||
extern struct RcloneRPCResult RcloneRPC(char* method, char* input);
|
||||
extern void RcloneFreeString(char* str);
|
||||
", $libshared);
|
||||
$this->rclone->RcloneInitialize();
|
||||
}
|
||||
|
||||
public function rpc( $method, $input ): array
|
||||
{
|
||||
$this->out = $this->rclone->RcloneRPC( $method, $input );
|
||||
$response = [
|
||||
'output' => \FFI::string( $this->out->Output ),
|
||||
'status' => $this->out->Status
|
||||
];
|
||||
$this->rclone->RcloneFreeString( $this->out->Output );
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function close( ): void
|
||||
{
|
||||
$this->rclone->RcloneFinalize();
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
Test program for librclone
|
||||
*/
|
||||
|
||||
include_once ( "rclone.php" );
|
||||
|
||||
const REMOTE = 'gdrive:/';
|
||||
const FOLDER = "rcloneTest";
|
||||
const FILE = "testFile.txt";
|
||||
|
||||
$rc = new Rclone( __DIR__ . '/librclone.so' );
|
||||
|
||||
$response = $rc->rpc( "config/listremotes", "{}" );
|
||||
print_r( $response );
|
||||
|
||||
$response = $rc->rpc("operations/mkdir",
|
||||
json_encode( [
|
||||
'fs' => REMOTE,
|
||||
'remote'=> FOLDER
|
||||
]));
|
||||
print_r( $response );
|
||||
|
||||
$response = $rc->rpc("operations/list",
|
||||
json_encode( [
|
||||
'fs' => REMOTE,
|
||||
'remote'=> ''
|
||||
]));
|
||||
print_r( $response );
|
||||
|
||||
file_put_contents("./" . FILE, "Success!!!");
|
||||
$response = $rc->rpc("operations/copyfile",
|
||||
json_encode( [
|
||||
'srcFs' => getcwd(),
|
||||
'srcRemote'=> FILE,
|
||||
'dstFs' => REMOTE . FOLDER,
|
||||
'dstRemote' => FILE
|
||||
]));
|
||||
print_r( $response );
|
||||
|
||||
$response = $rc->rpc("operations/list",
|
||||
json_encode( [
|
||||
'fs' => REMOTE . FOLDER,
|
||||
'remote'=> ''
|
||||
]));
|
||||
print_r( $response );
|
||||
if ( $response['output'] ) {
|
||||
$array = @json_decode( $response['output'], true );
|
||||
if ( $response['status'] == 200 && $array['list'] ?? 0 ) {
|
||||
$valid = $array['list'][0]['Name'] == FILE ? "SUCCESS" : "FAIL";
|
||||
print_r("The test seems: " . $valid . "\n");
|
||||
}
|
||||
}
|
||||
|
||||
$rc->close();
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"t
|
||||
.\" Automatically generated by Pandoc 2.9.2.1
|
||||
.\"
|
||||
.TH "rclone" "1" "Jul 09, 2022" "User Manual" ""
|
||||
.TH "rclone" "1" "Sep 15, 2022" "User Manual" ""
|
||||
.hy
|
||||
.SH Rclone syncs your files to cloud storage
|
||||
.PP
|
||||
@@ -732,9 +732,9 @@ system\[aq]s scheduler.
|
||||
If you need to expose \f[I]service\f[R]-like features, such as remote
|
||||
control (https://rclone.org/rc/), GUI (https://rclone.org/gui/),
|
||||
serve (https://rclone.org/commands/rclone_serve/) or
|
||||
mount (https://rclone.org/commands/rclone_move/), you will often want an
|
||||
rclone command always running in the background, and configuring it to
|
||||
run in a service infrastructure may be a better option.
|
||||
mount (https://rclone.org/commands/rclone_mount/), you will often want
|
||||
an rclone command always running in the background, and configuring it
|
||||
to run in a service infrastructure may be a better option.
|
||||
Below are some alternatives on how to achieve this on different
|
||||
operating systems.
|
||||
.PP
|
||||
@@ -770,7 +770,7 @@ c:\[rs]rclone\[rs]rclone.exe sync c:\[rs]files remote:/files --no-console --log-
|
||||
.fi
|
||||
.SS User account
|
||||
.PP
|
||||
As mentioned in the mount (https://rclone.org/commands/rclone_move/)
|
||||
As mentioned in the mount (https://rclone.org/commands/rclone_mount/)
|
||||
documentation, mounted drives created as Administrator are not visible
|
||||
to other accounts, not even the account that was elevated as
|
||||
Administrator.
|
||||
@@ -1271,6 +1271,11 @@ copy (https://rclone.org/commands/rclone_copy/) command if unsure.
|
||||
If dest:path doesn\[aq]t exist, it is created and the source:path
|
||||
contents go there.
|
||||
.PP
|
||||
It is not possible to sync overlapping remotes.
|
||||
However, you may exclude the destination from the sync with a filter
|
||||
rule or by putting an exclude-if-present file inside the destination
|
||||
directory and sync to a destination that is inside the source directory.
|
||||
.PP
|
||||
\f[B]Note\f[R]: Use the \f[C]-P\f[R]/\f[C]--progress\f[R] flag to view
|
||||
real-time transfer statistics
|
||||
.PP
|
||||
@@ -10973,7 +10978,8 @@ in DIR, then it will be overwritten.
|
||||
.PP
|
||||
The remote in use must support server-side move or copy and you must use
|
||||
the same remote as the destination of the sync.
|
||||
The backup directory must not overlap the destination directory.
|
||||
The backup directory must not overlap the destination directory without
|
||||
it being excluded by a filter rule.
|
||||
.PP
|
||||
For example
|
||||
.IP
|
||||
@@ -19707,7 +19713,7 @@ These flags are available for every command.
|
||||
--use-json-log Use json log format
|
||||
--use-mmap Use mmap allocator (see docs)
|
||||
--use-server-modtime Use server modified time instead of object metadata
|
||||
--user-agent string Set the user-agent to a specified string (default \[dq]rclone/v1.59.0\[dq])
|
||||
--user-agent string Set the user-agent to a specified string (default \[dq]rclone/v1.59.2\[dq])
|
||||
-v, --verbose count Print lots more stuff (repeat for more)
|
||||
\f[R]
|
||||
.fi
|
||||
@@ -34701,7 +34707,7 @@ remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
|
||||
|
||||
[AllDrives]
|
||||
type = combine
|
||||
remote = \[dq]My Drive=My Drive:\[dq] \[dq]Test Drive=Test Drive:\[dq]
|
||||
upstreams = \[dq]My Drive=My Drive:\[dq] \[dq]Test Drive=Test Drive:\[dq]
|
||||
\f[R]
|
||||
.fi
|
||||
.PP
|
||||
@@ -39081,7 +39087,7 @@ remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
|
||||
|
||||
[AllDrives]
|
||||
type = combine
|
||||
remote = \[dq]My Drive=My Drive:\[dq] \[dq]Test Drive=Test Drive:\[dq]
|
||||
upstreams = \[dq]My Drive=My Drive:\[dq] \[dq]Test Drive=Test Drive:\[dq]
|
||||
\f[R]
|
||||
.fi
|
||||
.PP
|
||||
@@ -41682,11 +41688,10 @@ Paths are specified as \f[C]remote:bucket\f[R] (or \f[C]remote:\f[R] for
|
||||
the \f[C]lsd\f[R] command.) You may put subdirectories in too, e.g.
|
||||
\f[C]remote:item/path/to/dir\f[R].
|
||||
.PP
|
||||
Once you have made a remote (see the provider specific section above)
|
||||
you can use it like this:
|
||||
.PP
|
||||
Unlike S3, listing up all items uploaded by you isn\[aq]t supported.
|
||||
.PP
|
||||
Once you have made a remote, you can use it like this:
|
||||
.PP
|
||||
Make a new item
|
||||
.IP
|
||||
.nf
|
||||
@@ -41741,7 +41746,7 @@ However, some fields are reserved by both Internet Archive and rclone.
|
||||
The following are reserved by Internet Archive: - \f[C]name\f[R] -
|
||||
\f[C]source\f[R] - \f[C]size\f[R] - \f[C]md5\f[R] - \f[C]crc32\f[R] -
|
||||
\f[C]sha1\f[R] - \f[C]format\f[R] - \f[C]old_version\f[R] -
|
||||
\f[C]viruscheck\f[R]
|
||||
\f[C]viruscheck\f[R] - \f[C]summation\f[R]
|
||||
.PP
|
||||
Trying to set values to these keys is ignored with a warning.
|
||||
Only setting \f[C]mtime\f[R] is an exception.
|
||||
@@ -41999,7 +42004,7 @@ string
|
||||
T}@T{
|
||||
01234567
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
format
|
||||
@@ -42010,7 +42015,7 @@ string
|
||||
T}@T{
|
||||
Comma-Separated Values
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
md5
|
||||
@@ -42021,7 +42026,7 @@ string
|
||||
T}@T{
|
||||
01234567012345670123456701234567
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
mtime
|
||||
@@ -42032,7 +42037,7 @@ RFC 3339
|
||||
T}@T{
|
||||
2006-01-02T15:04:05.999999999Z
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
name
|
||||
@@ -42043,7 +42048,7 @@ filename
|
||||
T}@T{
|
||||
backend/internetarchive/internetarchive.go
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
old_version
|
||||
@@ -42054,7 +42059,7 @@ boolean
|
||||
T}@T{
|
||||
true
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
rclone-ia-mtime
|
||||
@@ -42098,7 +42103,7 @@ string
|
||||
T}@T{
|
||||
0123456701234567012345670123456701234567
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
size
|
||||
@@ -42109,7 +42114,7 @@ decimal number
|
||||
T}@T{
|
||||
123456
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
source
|
||||
@@ -42120,7 +42125,18 @@ string
|
||||
T}@T{
|
||||
original
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
summation
|
||||
T}@T{
|
||||
Check https://forum.rclone.org/t/31922 for how it is used
|
||||
T}@T{
|
||||
string
|
||||
T}@T{
|
||||
md5
|
||||
T}@T{
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
T{
|
||||
viruscheck
|
||||
@@ -42131,7 +42147,7 @@ unixtime
|
||||
T}@T{
|
||||
1654191352
|
||||
T}@T{
|
||||
N
|
||||
\f[B]Y\f[R]
|
||||
T}
|
||||
.TE
|
||||
.PP
|
||||
@@ -53965,6 +53981,134 @@ Options:
|
||||
.IP \[bu] 2
|
||||
\[dq]error\[dq]: return an error based on option value
|
||||
.SH Changelog
|
||||
.SS v1.59.2 - 2022-09-15
|
||||
.PP
|
||||
See commits (https://github.com/rclone/rclone/compare/v1.59.1...v1.59.2)
|
||||
.IP \[bu] 2
|
||||
Bug Fixes
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
config: Move locking to fix fatal error: concurrent map read and map
|
||||
write (Nick Craig-Wood)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
Local
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Disable xattr support if the filesystems indicates it is not supported
|
||||
(Nick Craig-Wood)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
Azure Blob
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix chunksize calculations producing too many parts (Nick Craig-Wood)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
B2
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix chunksize calculations producing too many parts (Nick Craig-Wood)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
S3
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix chunksize calculations producing too many parts (Nick Craig-Wood)
|
||||
.RE
|
||||
.SS v1.59.1 - 2022-08-08
|
||||
.PP
|
||||
See commits (https://github.com/rclone/rclone/compare/v1.59.0...v1.59.1)
|
||||
.IP \[bu] 2
|
||||
Bug Fixes
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
accounting: Fix panic in core/stats-reset with unknown group (Nick
|
||||
Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
build: Fix android build after GitHub actions change (Nick Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
dlna: Fix SOAP action header parsing (Joram Schrijver)
|
||||
.IP \[bu] 2
|
||||
docs: Fix links to mount command from install docs (albertony)
|
||||
.IP \[bu] 2
|
||||
dropox: Fix ChangeNotify was unable to decrypt errors (Nick Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
fs: Fix parsing of times and durations of the form \[dq]YYYY-MM-DD
|
||||
HH:MM:SS\[dq] (Nick Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
serve sftp: Fix checksum detection (Nick Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
sync: Add accidentally missed filter-sensitivity to --backup-dir option
|
||||
(Nick Naumann)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
Combine
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix docs showing \f[C]remote=\f[R] instead of \f[C]upstreams=\f[R] (Nick
|
||||
Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
Throw error if duplicate directory name is specified (Nick Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
Fix errors with backends shutting down while in use (Nick Craig-Wood)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
Dropbox
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix hang on quit with --dropbox-batch-mode off (Nick Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
Fix infinite loop on uploading a corrupted file (Nick Craig-Wood)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
Internetarchive
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Ignore checksums for files using the different method (Lesmiscore)
|
||||
.IP \[bu] 2
|
||||
Handle hash symbol in the middle of filename (Lesmiscore)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
Jottacloud
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix working with whitelabel Elgiganten Cloud
|
||||
.IP \[bu] 2
|
||||
Do not store username in config when using standard auth (albertony)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
Mega
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix nil pointer exception when bad node received (Nick Craig-Wood)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
S3
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix --s3-no-head panic: reflect: Elem of invalid type s3.PutObjectInput
|
||||
(Nick Craig-Wood)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
SFTP
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix issue with WS_FTP by working around failing RealPath (albertony)
|
||||
.RE
|
||||
.IP \[bu] 2
|
||||
Union
|
||||
.RS 2
|
||||
.IP \[bu] 2
|
||||
Fix duplicated files when using directories with leading / (Nick
|
||||
Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
Fix multiple files being uploaded when roots don\[aq]t exist (Nick
|
||||
Craig-Wood)
|
||||
.IP \[bu] 2
|
||||
Fix panic due to misalignment of struct field in 32 bit architectures
|
||||
(r-ricci)
|
||||
.RE
|
||||
.SS v1.59.0 - 2022-07-09
|
||||
.PP
|
||||
See commits (https://github.com/rclone/rclone/compare/v1.58.0...v1.59.0)
|
||||
|
||||
+4
-4
@@ -39,19 +39,19 @@ type File struct {
|
||||
inode uint64 // inode number - read only
|
||||
size int64 // size of file - read and written with atomic int64 - must be 64 bit aligned
|
||||
|
||||
muRW sync.Mutex // synchronize RWFileHandle.openPending(), RWFileHandle.close() and File.Remove
|
||||
|
||||
mu sync.RWMutex // protects the following
|
||||
d *Dir // parent directory
|
||||
dPath string // path of parent directory. NB dir rename means all Files are flushed
|
||||
o fs.Object // NB o may be nil if file is being written
|
||||
leaf string // leaf name of the object
|
||||
writers []Handle // writers for this file
|
||||
nwriters int32 // len(writers) which is read/updated with atomic
|
||||
pendingModTime time.Time // will be applied once o becomes available, i.e. after file was written
|
||||
pendingRenameFun func(ctx context.Context) error // will be run/renamed after all writers close
|
||||
sys atomic.Value // user defined info to be attached here
|
||||
nwriters int32 // len(writers) which is read/updated with atomic
|
||||
appendMode bool // file was opened with O_APPEND
|
||||
sys atomic.Value // user defined info to be attached here
|
||||
|
||||
muRW sync.Mutex // synchronize RWFileHandle.openPending(), RWFileHandle.close() and File.Remove
|
||||
}
|
||||
|
||||
// newFile creates a new File
|
||||
|
||||
+8
-8
@@ -20,19 +20,19 @@ type ReadFileHandle struct {
|
||||
baseHandle
|
||||
done func(ctx context.Context, err error)
|
||||
mu sync.Mutex
|
||||
cond sync.Cond // cond lock for out of sequence reads
|
||||
cond *sync.Cond // cond lock for out of sequence reads
|
||||
closed bool // set if handle has been closed
|
||||
r *accounting.Account
|
||||
readCalled bool // set if read has been called
|
||||
size int64 // size of the object (0 for unknown length)
|
||||
offset int64 // offset of read of o
|
||||
roffset int64 // offset of Read() calls
|
||||
file *File
|
||||
hash *hash.MultiHasher
|
||||
remote string
|
||||
closed bool // set if handle has been closed
|
||||
readCalled bool // set if read has been called
|
||||
noSeek bool
|
||||
sizeUnknown bool // set if size of source is not known
|
||||
file *File
|
||||
hash *hash.MultiHasher
|
||||
opened bool
|
||||
remote string
|
||||
}
|
||||
|
||||
// Check interfaces
|
||||
@@ -63,7 +63,7 @@ func newReadFileHandle(f *File) (*ReadFileHandle, error) {
|
||||
size: nonNegative(o.Size()),
|
||||
sizeUnknown: o.Size() < 0,
|
||||
}
|
||||
fh.cond = sync.Cond{L: &fh.mu}
|
||||
fh.cond = sync.NewCond(&fh.mu)
|
||||
return fh, nil
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ func (fh *ReadFileHandle) readAt(p []byte, off int64) (n int, err error) {
|
||||
maxBuf = len(p)
|
||||
}
|
||||
if gap := off - fh.offset; gap > 0 && gap < int64(8*maxBuf) {
|
||||
waitSequential("read", fh.remote, &fh.cond, fh.file.VFS().Opt.ReadWait, &fh.offset, off)
|
||||
waitSequential("read", fh.remote, fh.cond, fh.file.VFS().Opt.ReadWait, &fh.offset, off)
|
||||
}
|
||||
doSeek := off != fh.offset
|
||||
if doSeek && fh.noSeek {
|
||||
|
||||
+17
-7
@@ -52,7 +52,7 @@ type Cache struct {
|
||||
avFn AddVirtualFn // if set, can be called to add dir entries
|
||||
|
||||
mu sync.Mutex // protects the following variables
|
||||
cond sync.Cond // cond lock for synchronous cache cleaning
|
||||
cond *sync.Cond // cond lock for synchronous cache cleaning
|
||||
item map[string]*Item // files/directories in the cache
|
||||
errItems map[string]error // items in error state
|
||||
used int64 // total size of files in the cache
|
||||
@@ -139,7 +139,7 @@ func New(ctx context.Context, fremote fs.Fs, opt *vfscommon.Options, avFn AddVir
|
||||
|
||||
// Create a channel for cleaner to be kicked upon out of space con
|
||||
c.kick = make(chan struct{}, 1)
|
||||
c.cond = sync.Cond{L: &c.mu}
|
||||
c.cond = sync.NewCond(&c.mu)
|
||||
|
||||
go c.cleaner(ctx)
|
||||
|
||||
@@ -739,17 +739,27 @@ func (c *Cache) clean(kicked bool) {
|
||||
oldItems, oldUsed := len(c.item), fs.SizeSuffix(c.used)
|
||||
c.mu.Unlock()
|
||||
|
||||
// Remove any files that are over age
|
||||
c.purgeOld(c.opt.CacheMaxAge)
|
||||
// loop cleaning the cache until we reach below cache quota
|
||||
for {
|
||||
// Remove any files that are over age
|
||||
c.purgeOld(c.opt.CacheMaxAge)
|
||||
|
||||
// If have a maximum cache size...
|
||||
if int64(c.opt.CacheMaxSize) > 0 {
|
||||
// Remove files not in use until cache size is below quota starting from the oldest first
|
||||
if int64(c.opt.CacheMaxSize) <= 0 {
|
||||
break
|
||||
}
|
||||
|
||||
// Now remove files not in use until cache size is below quota starting from the
|
||||
// oldest first
|
||||
c.purgeOverQuota(int64(c.opt.CacheMaxSize))
|
||||
|
||||
// Remove cache files that are not dirty if we are still above the max cache size
|
||||
c.purgeClean(int64(c.opt.CacheMaxSize))
|
||||
c.retryFailedResets()
|
||||
|
||||
used := c.updateUsed()
|
||||
if used <= int64(c.opt.CacheMaxSize) && len(c.errItems) == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// Was kicked?
|
||||
|
||||
@@ -57,16 +57,16 @@ type Item struct {
|
||||
// read only
|
||||
c *Cache // cache this is part of
|
||||
mu sync.Mutex // protect the variables
|
||||
cond sync.Cond // synchronize with cache cleaner
|
||||
cond *sync.Cond // synchronize with cache cleaner
|
||||
name string // name in the VFS
|
||||
opens int // number of times file is open
|
||||
downloaders *downloaders.Downloaders // a record of the downloaders in action - may be nil
|
||||
o fs.Object // object we are caching - may be nil
|
||||
fd *os.File // handle we are using to read and write to the file
|
||||
modified bool // set if the file has been modified since the last Open
|
||||
info Info // info about the file to persist to backing store
|
||||
writeBackID writeback.Handle // id of any writebacks in progress
|
||||
pendingAccesses int // number of threads - cache reset not allowed if not zero
|
||||
modified bool // set if the file has been modified since the last Open
|
||||
beingReset bool // cache cleaner is resetting the cache file, access not allowed
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ func newItem(c *Cache, name string) (item *Item) {
|
||||
ATime: now,
|
||||
},
|
||||
}
|
||||
item.cond = sync.Cond{L: &item.mu}
|
||||
item.cond = sync.NewCond(&item.mu)
|
||||
// check the cache file exists
|
||||
osPath := c.toOSPath(name)
|
||||
fi, statErr := os.Stat(osPath)
|
||||
|
||||
+6
-6
@@ -15,17 +15,17 @@ import (
|
||||
type WriteFileHandle struct {
|
||||
baseHandle
|
||||
mu sync.Mutex
|
||||
cond sync.Cond // cond lock for out of sequence writes
|
||||
cond *sync.Cond // cond lock for out of sequence writes
|
||||
closed bool // set if handle has been closed
|
||||
remote string
|
||||
pipeWriter *io.PipeWriter
|
||||
o fs.Object
|
||||
result chan error
|
||||
file *File
|
||||
offset int64
|
||||
flags int
|
||||
closed bool // set if handle has been closed
|
||||
writeCalled bool // set the first time Write() is called
|
||||
offset int64
|
||||
opened bool
|
||||
flags int
|
||||
truncated bool
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ func newWriteFileHandle(d *Dir, f *File, remote string, flags int) (*WriteFileHa
|
||||
result: make(chan error, 1),
|
||||
file: f,
|
||||
}
|
||||
fh.cond = sync.Cond{L: &fh.mu}
|
||||
fh.cond = sync.NewCond(&fh.mu)
|
||||
fh.file.addWriter(fh)
|
||||
return fh, nil
|
||||
}
|
||||
@@ -130,7 +130,7 @@ func (fh *WriteFileHandle) writeAt(p []byte, off int64) (n int, err error) {
|
||||
return 0, ECLOSED
|
||||
}
|
||||
if fh.offset != off {
|
||||
waitSequential("write", fh.remote, &fh.cond, fh.file.VFS().Opt.WriteWait, &fh.offset, off)
|
||||
waitSequential("write", fh.remote, fh.cond, fh.file.VFS().Opt.WriteWait, &fh.offset, off)
|
||||
}
|
||||
if fh.offset != off {
|
||||
fs.Errorf(fh.remote, "WriteFileHandle.Write: can't seek in file without --vfs-cache-mode >= writes")
|
||||
|
||||
Reference in new issue
Block a user