OxyCompBio / Oxy-Megadetector

1 stars 0 forks source link

Write script to automatically copy GDrive 'Upload' into 'Archive' #9

Closed max-mapper closed 1 year ago

max-mapper commented 3 years ago

For volunteers uploading photos we propose this workflow:

We can write the script in bash possibly using the https://rclone.org/ tool, and deploy it to somewhere like Google Cloud Run so it's easy to run

max-mapper commented 3 years ago

@Baez2222 I was thinking this might be a good one to work on for you too, we can jump on a call to plan it out at some point

max-mapper commented 3 years ago

algorithm idea:

  1. setup rclone remote for my personal gdrive with name 'gdrive' of type 'drive'
  2. mkdir mountpoint
  3. rclone mount gdrive:"UWINTest" mountpoint/
  4. find all images in UWINUpload
  5. loop over each image filename (source image paths) ['.ARW', '.JPG', '.jpg', '.jpeg', '.JPEG', '.png', '*.PNG']
  6. replace/modify the path to point at the destination (UWINArchive)
  7. construct a 'mv' command with the two paths above and then run it: mv mv UWINUpload/SAB1/IMG_0023.JPG UWINArchive/SAB1/IMG_0023.JPG

notes: https://github.com/maxogden/photocopier/blob/master/index.js

IMG_002.JPG { created_at: January 5, 2020 }

output_folder/2020-01-05-IMG_002.JPG