Best option to move all files BUT keep folders on source

Hi all, what is the best option to copy all folders structure from SOURCE to DEST, move all files form SOURCE to DEST and keep the folders structure (but not files) on SOURCE?

What i want to accomplish is having the same folder structure on SOURCE and DEST (actual folders + future folders) but MOVE all files from SOURCE to DEST every time they are uploaded to SOURCE.

I know that:

  • sync syncs contents so good for the first run, not for next ones
  • move moves everything (also folders?)
  • copy copies everything but doesn't delete source files...

Thanks.

No, actually rclone move only moves files by default. It will leave behind empty folders.
If you want empty folders to be deleted you CAN do this, but you would actually need to use the flag --delete-empty-src-dirs

There is similar flag for creating empty folders on DEST if you need this - because this will not happen by default.
You can read about the flags for rclone move here:
https://rclone.org/commands/rclone_move/

Can I ask what your purpose is for this is? Are you using a script to bulk-transfer your uploads maybe, and want to retain the folder structure so you can place the files you want to upload easily?
If so then the new multiwrite union might be perfect for you (in early beta - currently testing it out for NCW before it goes public).

In short - that will allow you (amongst many other things) to have a mount which acts like normal - except all new files created (or changed) can be sent to a local location for later script-upload. You can basically have the benefits of local write and upload script control, but make it appear as one seamless unit. IF that is what you are after that is... maybe I presumed your intentions wrongly here :slight_smile:

when you created your post, you were asked a bunch of questions.
can you answer them, like what is your operating system?

What is the problem you are having with rclone?

What is your rclone version (output from rclone version)

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

Which cloud storage system are you using? (eg Google Drive)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

Thanks. any user are uploading files to a public bucket, and once a month we want to move those files to a private one, simple as that. I've tried the move option and it effectively works as expected, so move is the best option for us, thanks. :grinning:

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