Problem with sync command

Hello all folks,
i have 4 shared folder on a windows 2025 server that i need to sync with OneDrive business, im using the last version of rclone v1.71.1
I use this command:

@SET TIMESTAMP=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%

rclone sync d:\sharedserver\folder remonedrive:folder/ --log-file=./logfile_folder%TIMESTAMP%.txt --log-level INFO --log-format=date,time,microseconds,pid,longfile,shortfile,UTC --stats-one-line

I encounter these two problems:

  • the file that i delete in the source dir are not deleted on remote onedrive
  • there are hidden file that have strange behaviour, think they are temp file of office docx or xlsx with that start with ~$, i tryed the option --filter "- **/~$*" but not working

this is the log that i have

2025/10/11 00:57:31.849412 slog/logger.go:256: [9864] ERROR : OneDrive root 'folder': not deleting files as there were IO errors
2025/10/11 00:57:31.849412 slog/logger.go:256: [9864] ERROR : OneDrive root 'folder': not deleting directories as there were IO errors
2025/10/11 00:57:31.849412 slog/logger.go:256: [9864] ERROR : Attempt 1/3 failed with 13 errors and: not deleting files as there were IO errors
2025/10/11 00:57:32.828061 slog/logger.go:256: [9864] ERROR : xxx/xxxx2/~$fileword.docx: Failed to set modification time: invalidRequest: Either 'folder' or 'file' must be provided, but not both.
2025/10/11 00:57:33.221320 slog/logger.go:256: [9864] ERROR : xxx/xxxx3/~$file2.doc: Failed to set modification time: invalidRequest: Either 'folder' or 'file' must be provided, but not both.
2025/10/11 00:57:36.138418 slog/logger.go:256: [9864] ERROR : xxx/xxxxx4/xxxxxx5/~$file3.docx: Failed to set modification time: invalidRequest: Either 'folder' or 'file' must be provided, but not both.

how can i delete the file that need to be synced?

how can avoid to copy the hidden files in all directories where they are?

thanks in advance

welcome to the forum,

default behavior, if there are errors in the sync command, rclone will not delete files.
https://rclone.org/docs/#delete-before-during-after


--exclude="~$*.doc*"


for testing, to keep the logs small, use --retries=1

Hello asdffdsa, ty for response, your suggestion work.

For other that read, i have also add to exclusion xlsx and xls, i dicorvered that i can use double exclusion in this manner

--exclude="~$*.xls*" --exclude="~$*.doc*"

For the error i wait the sync made this evening and check tomorrow

welcome


can do all that with a single exclusion
--exclude="~$*.{doc,xls}*"
or
--exclude="~$*.{doc,docx,xls,xlsx}"

All worked fine thanks!!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.