OESF Portables Forum

General Forums => General Discussion => Topic started by: gilkyboy on June 17, 2006, 10:35:21 am

Title: Sd To Ftp
Post by: gilkyboy on June 17, 2006, 10:35:21 am
I was wondering if anyone can help me with a problem.  I'm going to visit Germany this summer and am supposed to keep a website going with pictures of our trip.  I'd love it if I could just pop my SD card into my Zaurus and it would automagically FTP them to my school's website.  Can anyone help me out with this task?  Thanks in advance,
     gilkyboy
Title: Sd To Ftp
Post by: Ferret-Simpson on June 17, 2006, 10:56:02 am
You'd need a script that ran when you inserted the card. Wouldn't it just be easier to put the card in, go to the console and type "imgsdcardjobbyupload" and have that script upload them?
Title: Sd To Ftp
Post by: speculatrix on June 17, 2006, 05:30:51 pm
it's pretty easy to have an auto-ftp script. the first clue is to use a file called .netrc - create one in the home directory for user zaurus, and it looks like this:
Code: [Select]
machine ftp.example.com login zaurus password z4uru5change the host, the username and the password appropriately

this makes the "ftp ftp.example.com" automatically login for you.

then you need a script which will ftp all the files for you from the card and then move them to an "old" directory, thus:
Code: [Select]
#!/bin/bash

if [ ! -d  ../old ]; then
    mkdir ../old
fi

cd /mnt/card/imagefolder/new
echo "type i" > /tmp/ftpcommand
ls *.jpg *.JPG | awk '{ "put " $1 }' >> /tmp/ftpcommand
ftp ftp.example.com < /tmp/ftpcommand
mv *jpg *JPG ../old

# end
this is all off the top of my head, but something similar works for me and my webcam.

Paul