Ok. You will need a couple things installed. Number one: ImageMagick...for the command-line screenshot capture app "import"...and lftp which is a good command line ftp client which can be scripted. I suppose you could use plain old 'ftp' in a pinch, but I haven't tested it so you're on your own with that one.
Anyway,
you need to create two files. One is your lftp commands. I suggest naming it something like "~/.deskcam_upload" so it is out of your way. It would be like this:
Code:
open -u your_username,your_password ftp.your_ftp_server.com
put screenshot.png
quit
You would of course replace the relevant fields with your personal info (username, passwd, and ftp server). The first line just opens a connection to your server. The second line 'put's the screenshot into the home directory of your ftp server. There are many ways to customize what happens here, for instance: adding "-oremotefile" will name the uploaded file "remotefile", and adding "-O sub/directory/" will put the image in "sub/directory/". I direct you to man lftp for more info, specifically the 'put' command.
If all you want to do is put the file in the root of your server though...the default will work fine.
Now you need the actual script:
Code:
#!/bin/bash
#takes a screenshot. Name "screenshot.png" whatever you want
import -window root ~/screenshot.png
# now start lftp, and use the commands specified in "~/.deskcam_upload"
lftp -f ~/.deskcam_upload
# uncomment this if you want the screenie in your home directory deleted
# after uploading it...
#rm ~/screenshot.png
# this is just fluff but it will be emailed to you from the cron job:
echo "Screen shot uploaded"
# that's it!
This will take a screenshot of whatever is on your screen at the time it is run, so pay some mind to that. The import command takes different options as well, so check out the docs for ImageMagick if this is not what you want .
You can name this script anything you want, just make sure it is executable: "chmod +x scriptname.sh". Now, just set it up to be a daily cron task, and you're golden.