What is the problem you are having with rclone?
rclone move --delete-empty-src-dirs
acting differently (removing or not the directory) depending on being a server side move or not?
Use case: I want to rename some directories and some files. If I do rclone move
for directories (using SharePoint) the modified time of the files in the directories gets updated if using the WebDav API to access SharePoint. We use the WebDav API for another software (not related to rclone).
I'm trying to rename many directories keeping the modified date of the files.
Some weeks ago to fix a problem with this (not related to rclone, it was using SharePoint Web) I fixed the modified time visible to WebDav with Python+requests (doing a PATCH to the files, kudos for rclone -vv --dump bodies
so I could see what rclone was doing in similar cases to update the date modified date). Long story for another day (and 6 or 7 hours of processing...).
Now I'm trying to move some other directories in a way that feels less fragile.
What I've learned:
- If I do rclone move it does a server side move (hurray!) and in my opinion Microsoft has a bug where the WebDav modified date for the files in the directory get updated. I could technically then fix it with my Python+requests+PATCH but I'm trying to avoid this
- I thought of doing rclone "move" from a remote to another remote (from rclone point of view). Now I have an rclone-config with two remotes pointing to the same SharePoint library to "force" rclone to NOT do a server side copy. In the examples below when I have "test-SharePoint-2" and without the "-2" is the same config in two sections. rclone does the move it but it doesn't delete the source directory (but yes the files).
I've see though: --delete-empty-src-dirs flag not working - #5 by thestigma that it says that it never deletes the root directory? But it does (user point of view, or renames) if it's a server side move.
I want to say that if I do:
rclone --delete-empty-src-dirs --ignore-size --ignore-checksum "test-SharePoint:test41/" "test-SharePoint:test42/"
The source directory disappears (well, it gets moved on the server side)
If I do:
rclone --delete-empty-src-dirs --ignore-size --ignore-checksum "test-SharePoint:test41/" "test-SharePoint-2:test42/"
I would expect the same semantics but slow (download+upload). But the test41
directory stays (empty).
For my case I guess that I can just add && rclone rmdir test-SharePoint:test41/
after the move (not tested).
But I wondered if the rclone move
should behave the same for the server side and client side?
What is your rclone version (output from rclone version
)
rclone v1.55.0
- os/type: linux
- os/arch: amd64
- go/version: go1.16.2
- go/linking: static
- go/tags: cmount
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Linux 64 bit (Debian)
Which cloud storage system are you using? (eg Google Drive)
Microsoft SharePoint
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone move --delete-empty-src-dirs --ignore-size --ignore-checksum "test-SharePoint:test39/" "test-SharePoint:test40/"
And:
rclone move --delete-empty-src-dirs --ignore-size --ignore-checksum "test-SharePoint:test39/" "test-SharePoint-2:test40/"
The rclone config contents with secrets removed.
[test-SharePoint-2]
type = onedrive
token = {the token}
drive_id = the drive_id
drive_type = documentLibrary
A log from the command with the -vv
flag
carles@pinux:~$ rclone -vv move --delete-empty-src-dirs --ignore-size --ignore-checksum "test-SharePoint:test41/" "test-SharePoint-2:test42/"
2021/04/08 14:16:38 DEBUG : Using config file from "/home/carles/.rclone.conf"
2021/04/08 14:16:38 DEBUG : rclone: Version "v1.55.0" starting with parameters ["rclone" "-vv" "move" "--delete-empty-src-dirs" "--ignore-size" "--ignore-checksum" "test-SharePoint:test41/" "test-SharePoint-2:test42/"]
2021/04/08 14:16:38 DEBUG : Creating backend with remote "test-SharePoint:test41/"
2021/04/08 14:16:39 DEBUG : fs cache: renaming cache item "test-SharePoint:test41/" to be canonical "test-SharePoint:test41"
2021/04/08 14:16:39 DEBUG : Creating backend with remote "test-SharePoint-2:test42/"
2021/04/08 14:16:41 DEBUG : fs cache: renaming cache item "test-SharePoint-2:test42/" to be canonical "test-SharePoint-2:test42"
2021/04/08 14:16:42 DEBUG : One drive root 'test42': Waiting for checks to finish
2021/04/08 14:16:42 DEBUG : One drive root 'test42': Waiting for transfers to finish
2021/04/08 14:16:44 DEBUG : date5.txt: Starting multipart upload
2021/04/08 14:16:45 DEBUG : date5.txt: Uploading segment 0/5 size 5
2021/04/08 14:16:46 INFO : date5.txt: Copied (new)
2021/04/08 14:16:47 INFO : date5.txt: Deleted
2021/04/08 14:16:47 INFO :
Transferred: 5 / 5 Bytes, 100%, 1 Bytes/s, ETA 0s
Checks: 2 / 2, 100%
Deleted: 1 (files), 0 (dirs)
Renamed: 1
Transferred: 1 / 1, 100%
Elapsed time: 8.9s
2021/04/08 14:16:47 DEBUG : 9 go routines active