Hi all, this is a wonderful tool and I'm glad it exists!
I have some questions; let me start with what I want to do and then what I've tried.
What I want to do
I want to back up folders from my local machine to onedrive. The local folders have a mix of new and already backed up files, I want to backup/move/copy only the new files and delete everything locally (all files) once the backup is complete.
The items to be backed up are coming from my phone via syncthing. The flow I have in mind is the following:
- Phone > PC (via syncthing; already set up)
- PC > onedrive (check and only upload new files; files deleted locally shouldn't affect anything)
- Delete from PC
- Do this operation automatically overnight after 12am
Note that step 3 is mostly because I don't currently have enough storage to keep files on my PC but I plan to in the future, so delete for now but it will be nice to have the option to not delete later.
What I've tried
I experimented a little and this is the "ideal" command I ended up with. Ideal meaning I thought this had everything I needed
Command:
rclone move "local\windows\path" onedrive-rclone:"onedrive/path" --dry-run --log-file="logs.txt" --exclude-from "exclude.txt" --metadata --checksum -vv
Notes:
- Using
--checksum
because I saw that onedrive can have issues with file sizes and I would prefer not to have renamed duplicates. - Doing a
move
so local files are deleted after the operation. -
--metadata
seems useful and I thought better to have than to not have. -
exclude.txt
is to prevent deletion of syncthing [hidden] files.
exclude.txt
:
# https://forum.rclone.org/t/exclude-hidden-files/268/5
.*
.*/**
Version
rclone v1.59.2
- os/version: Microsoft Windows 10 Home 21H2 (64 bit)
- os/kernel: 10.0.19044.2006 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.18.6
- go/linking: static
- go/tags: cmount
Cloud: onedrive
Config file
[onedrive]
type = onedrive
token = {"access_token":"banana","token_type":"Bearer","refresh_token":"another banana","expiry":"queen's 100th birthday"}
drive_id = 69420
drive_type = personal
-vv
log
Snippet:
2022/09/30 14:30:24 DEBUG : Screenshot_20220522-193237.png: sha1 = d026a13e370e22f79e4ef240a556e81400951072 OK
2022/09/30 14:30:24 DEBUG : Screenshot_20220522-193237.png: Size and sha1 of src and dst objects identical
2022/09/30 14:30:24 DEBUG : Screenshot_20220522-193237.png: Unchanged skipping
2022/09/30 14:30:24 NOTICE: Screenshot_20220522-193237.png: Skipped delete as --dry-run is set (size 1.294Mi)
2022/09/30 14:30:24 DEBUG : One drive root 'onedrive/path': Waiting for transfers to finish
2022/09/30 14:30:24 INFO : There was nothing to transfer
2022/09/30 14:30:24 NOTICE:
Transferred: 5.154 GiB / 5.154 GiB, 100%, 0 B/s, ETA -
Checks: 25827 / 25827, 100%
Deleted: 8768 (files), 0 (dirs)
Renamed: 8291
Elapsed time: 12m16.7s
2022/09/30 14:30:24 DEBUG : 3 go routines active
Questions
- Why are there so many renamed files? Is this like appending "(2)" to a file name? I tried to
ctrl+f
with "rename" to find specific files that were renamed but it just finds the "Renamed: 8291" portion at the end of the log. - What mistakes have I made?
- Am I doing anything unecessary?
- Is there a better way to do this? Simpler the better!
- What's the
DEBUG : 3 go routines active
all about?