The script is downsize_uploads.rb. Run it like so:
cd /var/www/discourse
RAILS_ENV=production bundle exec ruby script/downsize_uploads.rb
It will try to downsize images to be 1 megapixel or less, or you can pass in the max size you want.
The script doesn’t scope it like that, but you can easily edit the script to do so. Add .where('created_at < ?, 1.year.ago)
to the query on line 10.