Reupload a bunch of content - OregonDigital/oregondigital GitHub Wiki

  1. Put a fixlist.yml together in the form of key-value pairs which map a "short pid" to a filename. e.g., df67vr88w: 2008May_pub_200805DSCSKitesArtistatWork_002.jpg
  2. Put all content files in an images directory that lives at the same root as the fixlist
  3. Go the the rails directory, /var/www/hydra/current, and run RAILS_ENV=production bundle exec rails runner /usr/local/deploy-rails/reupload/reingest.rb $fixdir, where $fixdir is where the fixlist and images dirs live.

Caveats: It doesn't do ANY sanity checking. If files are wrong, they're still uploaded. If pids are wrong, you can destroy data.

Consider double-checking that images are valid in the yml:

cat fixlist.yml | sed -e "s/\w\+: //" | xargs -i% ls images/% >/dev/null

Any output will be errors, so if there's no output, it's a good thing.