rclonesync does not sync empty directories
See original GitHub issueWhen syncing a local directory with a (Google Drive) remote, empty directories that exist either on Path1 or Path2 are not being created on the other. While for “end user files” this behavior might be acceptable, especially folder structures that belong to programs might expect empty directories to be in place.
Edit: Adding --rclone-args --create-empty-src-dirs
as last parameter unfortunately does not solve the issue, as --create-empty-src-dirs
is not a global rclone parameter. This results in rclone lsl
returning an error.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Force rclone to sync empty directories to Google Drive ...
Hi, I have a backupscript (using rclone sync) backing up to Google Drive ... that empty directories/folders does not get copied/created.
Read more >rsync - Synchronize content of two buckets/directories
Note 3: rsync does not copy empty directory trees, since Cloud Storage uses a flat namespace. Using -d Option (With Caution!) To Mirror...
Read more >Ubuntu Manpage: Rclone - syncs your files to cloud storage
It is always the contents of the directory that is synced, not the directory so when source:path is a directory, it's the contents...
Read more >Transferring Files Using rclone
Rclone allows users to copy or sync files from local storage to a cloud storage ... Please note that rclone transfers may be...
Read more >Download file from the shared folder of Google Drive by using ...
The line Configure this as a Shared Drive (Team Drive)?. Then the sync would be: rclone sync SharedDriveName:"Directory/Directory" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This sequence may get you close to what you need
The filtering in line 2 first includes all directories in path1, and then excludes everything else in path1. The empty directories in path1 are created on path2. The filtering on line 3 does the same for path2 to path1.
The limitation is that empty directories only accumulate, and must be manually deleted on both sides. You could use rlconesync’s
--remove-empty-directories
switch to clean them out of both paths, or rclone’srmdirs
command.Did you try the --remove-empty-directories switch?