What is the problem you are having with rclone?
Hello, I'm new to rclone and I'm struggling to figure out if there's a way to accomplish a task that I initially thought would be easy, but it seems it may not be as straight forward as I'd have hoped.
The high level TLDR:
Use Shared Folders in Google Drive and "rclone sync" to a Docker container. Then process the files and remove them from Google Drive using "rclone delete" when the container is given the command.
The details:
I'll start with the folder structure of my Google Drive (which I'm the account owner of).
I have a folder that I created called "users" which exclusively contains different shared folders (named using a uuid) that I've created for authorized users to sync content into. The content of any given user's folder will be more folders each containing one or more files to process.
Example:
users/ (I own this)
├─ 123456789/ (I created this and shared it)
│ ├─ Boss1/ (The user will have their Google Drive desktop client create these and their respective files)
│ │ ├─ log1.evtc (These files and folders will trickle in over 3hrs and then be processed and deleted on command)
│ ├─ Boss2/
│ │ ├─ log1.evtc
├─ 987654321/ (I created this and shared it)
│ ├─ Boss3/
│ │ ├─ log1.evtc
│ │ ├─ log2.evtc
This users folder is being sync'd to my Docker container using "rclone sync" with this being the file driving the syncing.
And this container specific config file:
{
"defaultSource": "/",
"defaultSyncOptions": "",
"syncInterval": 10000,
"remotes": [
{
"name": "google-drive",
"source": "/DiscordBots/Blaze/arcdps",
"destination": "/arcdps",
"syncOptions": "--create-empty-src-dirs"
}
]
}
So far - I have all this working.
Where I get stuck is when I want to "rclone delete" those "Boss" folders and their contained files so I'm down to just the shared folders again.
Desired final state after deletion:
users/
├─ 123456789/
├─ 987654321/
When I attempt the command in the section below I get insufficientFilePermissions
.
I've considered the idea of something like "rclone move" or "rclone bisync", but I don't know if there is a workflow that would yield quite the same desired behavior.
The theorized workflow looks like this:
A player has a third party logging tool on their PC that automatically creates these Boss folders and their respective logs after any given attempt of the fight (accumulating all successful or failed attempts) at a desired location which they will configure to their assigned shared folder. This will be sync'd to my Google Drive from their Google Drive desktop client. My Docker container will poll my Google Drive for changes every few seconds/minutes and sync the content of all the users folders into the container. The container will then be given a processing command and upload those logs to a different third party service (again, to this point everything is working). Once uploaded the contents of the user's shared folder should be deleted (this is where I get a permission error).
Run the command 'rclone version' and share the full output of the command.
root@d591ecb8ed6c:/# rclone version
rclone v1.61.1
- os/version: ubuntu 18.04 (64 bit)
- os/kernel: 5.10.16.3-microsoft-standard-WSL2 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.19.4
- go/linking: static
- go/tags: none
Which cloud storage system are you using? (eg Google Drive)
Google Drive
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone delete google-drive:/DiscordBots/Blaze/arcdps/users/123159732146929666 --rmdirs
The rclone config contents with secrets removed.
[google-drive]
type = drive
client_id = ...
client_secret = ...
scope = drive
token = {"access_token":"...","token_type":"Bearer","refresh_token":"...","expiry":"2022-12-19T05:27:55.9934681-06:00"}
team_drive =
A log from the command with the -vv
flag
root@d591ecb8ed6c:/# rclone delete google-drive:/DiscordBots/Blaze/arcdps/users/123159732146929666 --rmdirs -vv
2023/01/12 04:00:00 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "delete" "google-drive:/DiscordBots/Blaze/arcdps/users/123159732146929666" "--rmdirs" "-vv"]
2023/01/12 04:00:00 DEBUG : Creating backend with remote "google-drive:/DiscordBots/Blaze/arcdps/users/123159732146929666"
2023/01/12 04:00:00 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/01/12 04:00:00 DEBUG : Google drive root 'DiscordBots/Blaze/arcdps/users/123159732146929666': 'root_folder_id = 0AP-aMbxMsFVIUk9PVA' - save this in the config to speed up startup
2023/01/12 04:00:01 DEBUG : fs cache: renaming cache item "google-drive:/DiscordBots/Blaze/arcdps/users/123159732146929666" to be canonical "google-drive:DiscordBots/Blaze/arcdps/users/123159732146929666"
2023/01/12 04:00:01 DEBUG : Waiting for deletions to finish
2023/01/12 04:00:02 ERROR : Slothasor/20230109-230034.zevtc: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/12 04:00:02 ERROR : Slothasor/20230109-225533.zevtc: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/12 04:00:02 ERROR : Slothasor/20230109-225201.zevtc: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/12 04:00:02 ERROR : Attempt 1/3 failed with 4 errors and: failed to delete 3 files
2023/01/12 04:00:02 DEBUG : Waiting for deletions to finish
2023/01/12 04:00:03 ERROR : Slothasor/20230109-225533.zevtc: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/12 04:00:03 ERROR : Slothasor/20230109-230034.zevtc: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/12 04:00:03 ERROR : Slothasor/20230109-225201.zevtc: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/12 04:00:03 ERROR : Attempt 2/3 failed with 4 errors and: failed to delete 3 files
2023/01/12 04:00:03 DEBUG : Waiting for deletions to finish
2023/01/12 04:00:04 ERROR : Slothasor/20230109-225201.zevtc: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/12 04:00:04 ERROR : Slothasor/20230109-225533.zevtc: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/12 04:00:04 ERROR : Slothasor/20230109-230034.zevtc: Couldn't delete: googleapi: Error 403: The user does not have sufficient permissions for this file., insufficientFilePermissions
2023/01/12 04:00:04 ERROR : Attempt 3/3 failed with 4 errors and: failed to delete 3 files
2023/01/12 04:00:04 DEBUG : 8 go routines active
2023/01/12 04:00:04 Failed to delete with 4 errors: last error was: failed to delete 3 files