Thanks @ncw. I did attempt that earlier however experienced errors. Please see the post above.
You tried this in that post
I mean try this
rclone delete --dry-run --files-from filelist.txt dropbox:
Sorry @ncw. I overlooked the suggestion of using delete
as opposed to deletefile
. Sleep deprivation has its downsides
Is there any equivalent to selectively purge directories (with content)?
No worries!
It depends exactly what you want. If you want to delete everything from a directory use rclone purge
.
You can use filters to specify directories, so --include /path/to/dir/**
will include all files things in the root of the remote with the path path/to/dir
so everything in that directory and subdirectories.
You could use rclone delete --dry-run --include "/path/to/dir/**" remote:
to delete that directory
You can repeat the --include
filter.
This will only delete files though so you'd need to follow it up with rclone rmdirs remote:path/to/dir
to delete any empty directories
Thanks @ncw.
If the objective is to delete select directories such as dir1,dir4, dir20 (with contents), would it be safe to assume that the command would be rclone --dry-run --include dir1/** --include dir4/** --include dir20/** remote:
assuming that dir1, dir4 and dir20 are in the root directory.
Almost... you want --include /dir1/**
etc to ensure you delete dir
only in the root, not anywhere in the directory structure.
Thanks for the suggestion @ncw. If /
is absent such as dir1
does the command delete child directories? I would have thought that it would delete the relative path to the remote
location.
--include "dir/**"
means any files in a directory called "dir" anywhere under the remote.
--include "/dir/**"
means any files in a directory called "dir" in the transfer root
Leading /
makes the include at the root of the transfer otherwise it is anywhere in the transfer.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.