conradin
May 24th, 2011, 05:54 PM
Hi all, I have an Expect script (I dont mind converting to bash)
which takes an image from my web cam then sends it to my FTP server.
That part seems fine, but what I need to do is make the script modify the
file name with a date (date & time) when it is loading it to the server.
Currently, my file persistently overwrites it self.
I'm trying to set up a real simple security camera type script so I can see
if my roommates are going in my room when I'm not around.
#!/usr/bin/expect
spawn streamer -f jpeg -o /home/j/image.jpeg
expect "16"
sleep 10
spawn ftp ftp.server.edu
expect ":"
send "UserName\r"
expect "Password:"
send "PassWord\r"
expect "ftp>"
send "put /home/j/image.jpeg /webCamImage.jpeg\r"
expect "ftp>"
send "bye\r"
which takes an image from my web cam then sends it to my FTP server.
That part seems fine, but what I need to do is make the script modify the
file name with a date (date & time) when it is loading it to the server.
Currently, my file persistently overwrites it self.
I'm trying to set up a real simple security camera type script so I can see
if my roommates are going in my room when I'm not around.
#!/usr/bin/expect
spawn streamer -f jpeg -o /home/j/image.jpeg
expect "16"
sleep 10
spawn ftp ftp.server.edu
expect ":"
send "UserName\r"
expect "Password:"
send "PassWord\r"
expect "ftp>"
send "put /home/j/image.jpeg /webCamImage.jpeg\r"
expect "ftp>"
send "bye\r"