/home/ak/
» Menu
Blog
» Show list
Information
Photography
Projects
Articles
» Latest photo
Thunderstorm, 20100808-_AK00278

[See all]
» My latest @ Flickr
Thunderstorm, 20100808-_AK00278 Thunderstorm, 20100808-_AK00252
Thunderstorm, 20100808-_AK00157 Thunderstorm, 20100808-_AK00301
» My latest @ YouTube
» Control board for a ...
» 5DmkII macro video test
» Tangband W4-657SC te...
» Kitty looking around...
» Robot arm - first test
» RSS-feeds
» Blog
» Projects
» Links
» Metku.net
» Teknolelu  FI
» Suomikuva  FI
» Valotuli  FI
 
Valid HTML 4.01!
Valid CSS!
Get Firefox!

© Aki Korhonen





 


Photos back online

 Fri, 26 Sep 2008 02:38:37

All photos in the blog, projects and photography -sections are online again. My latest backup was two months old (oops, won't happen again) so I had to rebuild the whole data structure. Luckily I had a list of the uploaded files in the database and here is what I had to do:

  • File list from the SQL database.

  • Make an index file from about all the image files on my computer (I used cygwin so I could use those handy unix tools to generate the index file like this: find -iname '*.jpg' -print > image_file_index.txt)

  • PHP script that filtered all unneeded files from the image file index.

  • Another script that made a batch file with the info from previous script and that copies all the needed images to one place from around the hard drive.

  • Third script that made a huge batch file that uses ImageMagick's convert to resize and make all the needed thumbnails (two different sizes) etc according to the file information from the database and the batch then moved everything to the right places.


Maybe there would have been another way of doing all that but it worked so whatever. Also a lesson was learnt: REMEMBER THOSE BACKUPS!