September 02, 2007

From Linux to Flickr

So I have a minor ass-ton of photos on my olde web server from before I put everything on Flickr. Most of them are sitting in an old OLD version of Gallery that's been getting pounded by spam comments. I finally decided to pull the plug on Gallery, but I want to migrate the photos to flickr.

The problem, however, is that there is not an official uploader for linux. I could zip up the files and move them to a windows box (or put them on a Samba share my laptop could get to), but I decided to be a bit mroe direct and remembered that flickr accepts uploads via e-mail.

I noodled out this little script to do the deed for me:

for i in `find -name '*.jpg' |grep -v '\.sized\.' |grep -v '\.thumb\.' |grep -v '\.highlight\.' |cut -f2 -d'/' ` 
    do echo $i 
    uuencode $i $i | mail -s "$i tags: tag tags more.tags from.gallery" {my_upload_address}@photos.flickr.com  
done

Sweet.

The only problem is that after getting to the albums of my shots from my Canon Digital Rebel, I've realized that I need a 'sleep' statement in there to let the mail servers/interweb tubes cool off a bit :)

Hack hack hack.

Posted by oblivion at September 2, 2007 01:15 AM | TrackBack | Technorati Tags: