okay, it took me a few tries until i got the date format right, it seems like i need to escape the / first.
but it seems to do exactly what i want! thank you very much
#!/bin/bash
# Step 1: Get all unique YYYY-MM-DD values from files in the current directory
unique_dates=$(rclone lsf --files-only --format t --quiet . | cut -c1-10 | sort | uniq)
# Step 2: Loop over each unique date and move files to their destination
for date in $unique_dates; do
echo -e "\e[93mMoving .JPG files modified on $date to myNextcloud:Photos/${date//-/\/}"
echo -e "\e[39m"
rclone move --include "*.JPG" --metadata-include "mtime=${date}*" . "myNextcloud:Photos/${date//-/\/}" -P
done
echo -e "\e[92mAll .JPG files have been organized by date."
Output:
[paul@computer 101_FUJI]$ ~/Maintenance/move-sdcard-jpg-to-nextcloud.sh
Moving files modified on 2025-10-11 to dest_remote:Photos/2025/10/11
Transferred: 7.362 GiB / 7.362 GiB, 100%, 17.517 MiB/s, ETA 0s
Checks: 355 / 355, 100%, Listed 651
Deleted: 355 (files), 0 (dirs), 7.362 GiB (freed)
Renamed: 355
Transferred: 355 / 355, 100%
Elapsed time: 5m41.1s
Moving files modified on 2025-10-12 to dest_remote:Photos/2025/10/12
Transferred: 209.654 MiB / 209.654 MiB, 100%, 17.471 MiB/s, ETA 0s
Checks: 11 / 11, 100%, Listed 296
Deleted: 11 (files), 0 (dirs), 209.654 MiB (freed)
Renamed: 11
Transferred: 11 / 11, 100%
Elapsed time: 12.6s
Moving files modified on 2025-10-13 to dest_remote:Photos/2025/10/13
Transferred: 3.627 GiB / 3.627 GiB, 100%, 17.717 MiB/s, ETA 0s
Checks: 175 / 175, 100%, Listed 285
Deleted: 175 (files), 0 (dirs), 3.627 GiB (freed)
Renamed: 175
Transferred: 175 / 175, 100%
Elapsed time: 3m58.3s
Moving files modified on 2025-10-15 to dest_remote:Photos/2025/10/15
Transferred: 1.867 GiB / 1.867 GiB, 100%, 13.888 MiB/s, ETA 0s
Checks: 110 / 110, 100%, Listed 110
Deleted: 110 (files), 0 (dirs), 1.867 GiB (freed)
Renamed: 110
Transferred: 110 / 110, 100%
Elapsed time: 2m35.8s
All files have been organized by date.
I kept the –-dry-run option on purpose to test if everything works before actually touching the files 
EDIT: added color to terminal output in bash script