OESF Portables Forum
General Forums => General Discussion => Topic started 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
-
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?
-
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:
machine ftp.example.com login zaurus password z4uru5
change 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:
#!/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