akikorhonen
» Menu
» My latest @ Flickr
Aurora Borealis - Tampere, Finland 2013-03-17 20130304-1705-DSC_3810 [Browse]
» My latest @ YouTube
» Links
 
/home/ak/blog/photos-back-online
Loading latest tweet from @akeeh

  Friday, 26. September 2008


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!

Category: Website  |  Tags: fail, update