Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
automate ftp upload script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
chr1z
Apprentice
Apprentice


Joined: 17 Jul 2002
Posts: 207

PostPosted: Fri Feb 28, 2003 1:51 pm    Post subject: automate ftp upload script Reply with quote

i would like to have a script which takes a screenshot
and uploads it to a ftp server.
any idea how i a simple bash script could look like?
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Tue Aug 26, 2003 3:08 pm    Post subject: Reply with quote

i am interested in exact this as well.
_________________
proud to be a scout and a chronic penguin hugger
Legion of Lore - site
Back to top
View user's profile Send private message
scriptkiddie
l33t
l33t


Joined: 30 Mar 2003
Posts: 955

PostPosted: Tue Aug 26, 2003 3:13 pm    Post subject: Reply with quote

ACCEPT_KEYWORDS=~x86 emerge fbgrab

Set the following up as a cron job weekly or whatever

#!/bin/bash
fbgrab ~/console.png
echo "Screenshot taken!"
# Insert FTP stuff here... I'm no good with command line FTP
echo "Upload Successfully"
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Tue Aug 26, 2003 5:04 pm    Post subject: Reply with quote

i made something this afternoon (just finished it)
to take a screenshot, upload it to ftp, and then
open my browser on that page to check it.

ingredients:

scrot
lftp
a browser

first, i created a directory ~/.shot_script to put
everything in. then, i created 'shot.ftp' in that
dir, which contains the following commands
to be called for by lftp:

Code:
open ftp://username:password@server.com
rm shot.png
put ~/.shot_script/shot.png
exit


this will connect to your server of choice, remove
any existing screenshot, then put your new shot
where it was, and then it will end lftp.

next, i created the file 'shot.script', which holds
the commands to take the screenshot, run lftp
set to run commands from shot.ftp, remove the
shot which was just uploaded and then it will
run your browser of choice which will open the
url to your shot.

Code:
scrot ~/.shot_script/shot.png
lftp -f ~/.shot_script/shot.ftp
rm ~/.shot_script/shot.png
[browser] http://url_to_shot.png


next, i ran chmod +x ~/.shot_script/shot.script
to make the script executable.

and last but not least, i added a link to that
script in my popup menu (which will cause scrot
to take a shot without the popup menu open,
since the popup menu closes at release so the
shot is nice and clean).

the command to put in your menu is:

exec ~/.shot.script


that's all folks. enjoy.
_________________
proud to be a scout and a chronic penguin hugger
Legion of Lore - site
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Wed Sep 17, 2003 5:50 pm    Post subject: Reply with quote

i am now using import to take the screenshot,
and also i am using the jpeg format now, with
a high quality setting, so that it looks almost
the same as the png version, while often being
a lot smaller in filesize.

the line to take the shot is:

import -window root -quality 90 ~/.shot_script/shot.jpg

and replace the instances of shot.png in both the
shot.script + shot.ftp files with shot.jpg.

enjoy.
_________________
proud to be a scout and a chronic penguin hugger
Legion of Lore - site
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Thu May 06, 2004 11:17 am    Post subject: Reply with quote

i just noticed that the quality variable with scrot sets the
compression ratio for png. since png looks better than
jpeg, even when compressed, i now use:

scrot -q 1 ~/.shot_script/shot.png

which often makes a smaller file than the jpeg with higher
quality.

hurray :wink:

ps. for a more advanced script, check here
_________________
proud to be a scout and a chronic penguin hugger
Legion of Lore - site
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum