How to delete sub folders within folder structure

What is the problem you are having with rclone?

WI am trying to find a way to have rclone delete sub-folder structures, but, not the top level folder structure. The current command below, almost does what I want, but it instead deletes all folders. Which then breaks my automation tools since it can't find the original folder to place things into.

Folder 1
|---Sub Folder 1
|---Sub Folder 2
Folder 2
|---Sub Folder 3
|---Sub Folder 4

So what I am trying to do here is clear out ONLY the sub folders and not the folder 1 or 2 locations.

What is your rclone version (output from rclone version)

$ rclone version
rclone v1.51.0
- os/arch: linux/amd64
- go version: go1.13.7

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Ubuntu 20.04 LTS

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)

/usr/bin/rclone move /mnt/pool/media/ gmedia: -P --log-file /var/log/rclone.log -v --exclude-from /etc/rclone/exclude-tvmovie.txt --delete-empty-src-dirs --max-transfer 740G --checkers 4 --min-age 3h --drive-chunk-size 64M


you can run multiple commands

one for each subfolder you want to move
rclone move "/mnt/pool/media/Folder 1" "gmedia:/media/Folder 1" --delete-empty-src-dirs
rclone move "/mnt/pool/media/Folder 2" "gmedia:/media/Folder 2" --delete-empty-src-dirs

or after your command is done, re-create the folders

rclone move /mnt/pool/media/ gmedia: 
mkdir "/mnt/pool/media/Folder 1"
mkdir "/mnt/pool/media/Folder 2"

Yeah I was hoping for a better alternative to this, that didn't require multiple lines of the move, but simple enough to change up I guess.

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