Gallery2 Cron-job to automate “build-all-thumbnail/resizes”

Below is a script for Gallery2 to automate the building and resizing of thumbnails and resizes. Schedule it as a cron-job (cut and paste it to “gallery2-rebuilt” in your “/etc/cron.daily” folder). You can even schedule this script from a remote linux machine which does not host the Gallery2. Dependencies are minimal (no CURL used)! [...]