Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

automate ftp upload script

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
chr1z
Apprentice
Apprentice
Posts: 207
Joined: Wed Jul 17, 2002 6:55 pm

automate ftp upload script

  • Quote

Post by chr1z » Fri Feb 28, 2003 1:51 pm

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?
Top
neenee
Veteran
Veteran
User avatar
Posts: 1786
Joined: Sun Jul 20, 2003 12:15 pm

  • Quote

Post by neenee » Tue Aug 26, 2003 3:08 pm

i am interested in exact this as well.
Top
scriptkiddie
l33t
l33t
User avatar
Posts: 955
Joined: Sun Mar 30, 2003 2:47 am
Contact:
Contact scriptkiddie
Website

  • Quote

Post by scriptkiddie » Tue Aug 26, 2003 3:13 pm

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"
Top
neenee
Veteran
Veteran
User avatar
Posts: 1786
Joined: Sun Jul 20, 2003 12:15 pm

  • Quote

Post by neenee » Tue Aug 26, 2003 5:04 pm

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: Select all

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: Select all

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.
Top
neenee
Veteran
Veteran
User avatar
Posts: 1786
Joined: Sun Jul 20, 2003 12:15 pm

  • Quote

Post by neenee » Wed Sep 17, 2003 5:50 pm

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.
Top
neenee
Veteran
Veteran
User avatar
Posts: 1786
Joined: Sun Jul 20, 2003 12:15 pm

  • Quote

Post by neenee » Thu May 06, 2004 11:17 am

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
Top
Post Reply

6 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic