Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Onödigt shell script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Scandinavian
View previous topic :: View next topic  
Author Message
LimeFrog
Apprentice
Apprentice


Joined: 31 Mar 2003
Posts: 187
Location: Skövde, Sweden

PostPosted: Wed Jun 04, 2003 6:21 pm    Post subject: Onödigt shell script Reply with quote

Det är så att jag har fått för mig att göra ett väldigt onödigt shell script men vet inte riktigt hur jag ska gå till väga. Först ska jag ta en skärmdump med scrot (detta behöver jag ingen hjälp med), men sedan så vill jag att skärmdumpen automatiskt ska uploadas till en FTP. Jag försökte med något i denna stilen
Code:
#!/bin/bash
scrot &
ftp ftp.hemsida.com 21 &
user användare lösenord

ja ni fattar nog, men det funkar ju dessvärre inte så. :?
Förslag någon? :)
_________________
I don't believe in God, but I'm afraid of him!
Back to top
View user's profile Send private message
Yarrick
Bodhisattva
Bodhisattva


Joined: 05 Jun 2002
Posts: 304
Location: Malmö, Sweden

PostPosted: Wed Jun 04, 2003 8:07 pm    Post subject: Reply with quote

kanske
Code:
ftp user:pass@server
?
Back to top
View user's profile Send private message
LimeFrog
Apprentice
Apprentice


Joined: 31 Mar 2003
Posts: 187
Location: Skövde, Sweden

PostPosted: Wed Jun 04, 2003 8:30 pm    Post subject: Reply with quote

shame on me, varför tänkte jag inte på det.. :)
ok steg 2, hur får jag med upload kommandot? :)
_________________
I don't believe in God, but I'm afraid of him!
Back to top
View user's profile Send private message
LimeFrog
Apprentice
Apprentice


Joined: 31 Mar 2003
Posts: 187
Location: Skövde, Sweden

PostPosted: Wed Jun 04, 2003 8:43 pm    Post subject: Reply with quote

Nu när jag testade det i praktiken funkade det inte alls. :(
ftp tror att server adressen är user:pass@server så ett steg tillbaks igen. :?
_________________
I don't believe in God, but I'm afraid of him!
Back to top
View user's profile Send private message
far
Guru
Guru


Joined: 10 Mar 2003
Posts: 394
Location: Stockholm, Sweden

PostPosted: Fri Jun 06, 2003 2:23 pm    Post subject: Reply with quote

Skaffa en bättre ftp-klient, t.ex. yafc:
http://yafc.sourceforge.net/
_________________
The Porthole Portage Frontend
Back to top
View user's profile Send private message
dev-null-devil
Tux's lil' helper
Tux's lil' helper


Joined: 12 May 2003
Posts: 93

PostPosted: Sun Jun 08, 2003 6:39 pm    Post subject: Reply with quote

Om nu jag skulle göra något sådant skulle ja använda php med funktionen fopen och fwrite. Glöm inte att använda binary-mode. Visst, många anser att jag är dryg nu, men det är det enda sättet jag kommer på just nu.. Lycka till!
_________________
All change, motion, and time is an illusion.
-- Plato, year 310
Back to top
View user's profile Send private message
far
Guru
Guru


Joined: 10 Mar 2003
Posts: 394
Location: Stockholm, Sweden

PostPosted: Sun Jun 08, 2003 8:16 pm    Post subject: Reply with quote

Varför php när det finns python? :)
Code:
#!/usr/bin/env python
from ftplib import FTP
server = 'ftp.spam.se'
user = 'far'
pword = 'muffins'
filename = 'spam.txt'
ftp = FTP(server)
ftp.login(user, pword)
ftp.storbinary('STOR ' + filename, open(filename))

_________________
The Porthole Portage Frontend
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Scandinavian 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