Create sequentially numbered targeted directories and batch move files (Rclone and Dropbox)

I need help with file re-organization. I would like to create sequentially numbered targeted folders and move .ZIP files from Dropbox #1 to Dropbox #2. On second Dropbox i need folders like 1, 2, 3,.. and 7 files per folder. It's possible to somehow use RCLONE sync command with below code or does Rclone supports something like that?

find source -type f -name 'backups*.zip' -print0 | \
sort -z --version-sort | \
xargs -0n7 bash -c 'TARGET=target-$((${1//[^0-9]/} / 7 + 1)); \
mkdir -p "$TARGET"; \
mv -t "$TARGET" "$@"' move-7

I need to move (or just organize on same Dropbox) arround 500.000 files. Any help would be great.
Thank you!

hi,

might use rclone mount and then a script like that should work as is.

1 Like