egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ftp help required

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Tue Nov 16, 2010 7:57 am    Post subject: ftp help required Reply with quote

Hey can any one help with an ftp script i need to be able to upload some files to my website via my eggdrop every couple of minutes but the bot will need to do it auto ive tried the scripts in the archives and none of them seem to work properly any help greatly appreciated
_________________
Blake
UKEasyHosting UKStormWatch
Back to top
View user's profile Send private message Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Tue Nov 16, 2010 12:06 pm    Post subject: Re: ftp help required Reply with quote

blake wrote:
Hey can any one help with an ftp script i need to be able to upload some files to my website via my eggdrop every couple of minutes but the bot will need to do it auto ive tried the scripts in the archives and none of them seem to work properly any help greatly appreciated


I remember doing something like this, some time ago though.

As I recall, I didn't use the bot at all. You might give this some thought.

Try using an ftp script instead. Just have it log into your other server, and upload the files - don't involve the bot at all.

You can schedule the script's runs, with crontab.

I seem to remember that there was some minor little trick to writing a script file that worked properly. I'm sure I found it, just by googling.
Give it a try... google for things like:
linux ftp script
and
linux ftp commands
and, if you need help with crontab, you can google it too, or visit:
http://ss64.com/bash/


I hope this helps.
Back to top
View user's profile Send private message
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Tue Nov 16, 2010 2:33 pm    Post subject: Re: ftp help required Reply with quote

I need it to work with an eggdrop because i have a few different files that need uploading to different directories on my website so the script will be working on to different eggdrops doing it through my shell will make this difficult
_________________
Blake
UKEasyHosting UKStormWatch
Back to top
View user's profile Send private message Visit poster's website
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Fri Nov 19, 2010 11:50 pm    Post subject: Reply with quote

Well, here's some ftp uploader code I wrote for my pisg files, minus the pisg functionality (because it's probably redundant to you):
Code:
#FTP Host:
set daFTPsite "ftp.site.com"

#FTP User:
set daFTPuser "ftpuser"

#FTP Pass:
set daFTPpass "ftppass"

#Local Location:
set daFTPlocal "/directory/on/your/shell"

#Remote Location
set daFTPremote "./directory/to/your/websites/home/directory"

bind time - "* * * * *" timed:upload

bind pub m "!upload" command:upload

proc timed:upload {m h d m y} {
global daFTPsite daFTPuser daFTPpass daFTPlocal daFTPremote

   set ftp [open "|/usr/bin/ftp -n $daFTPsite" w]
   putlog "FTP: Starting FTP Upload..."
   puts $ftp "user $daFTPuser $daFTPpass"
   puts $ftp "bin"
   puts $ftp "put $daFTPlocal/index.html $daFTPremote/index.html"
#   puts $ftp "put $daFTPlocal/gigirc.html $daFTPremote/gigirc.html"
#   puts $ftp "put $daFTPlocal/pingbad.html $daFTPremote/pingbad.html"
   puts $ftp "quit"
   close $ftp
   putlog "FTP: Upload Complete."
}

proc command:upload {nick uh hand chan args} {
global daFTPsite daFTPuser daFTPpass daFTPlocal daFTPremote

   set ftp [open "|/usr/bin/ftp -n $daFTPsite" w]
   putlog "FTP: Starting FTP Upload..."
   puts $ftp "user $daFTPuser $daFTPpass"
   puts $ftp "bin"
   puts $ftp "put $daFTPlocal/index.html $daFTPremote/index.html"
#   puts $ftp "put $daFTPlocal/gigirc.html $daFTPremote/gigirc.html"
#   puts $ftp "put $daFTPlocal/pingbad.html $daFTPremote/pingbad.html"
   puts $ftp "quit"
   close $ftp
   putlog "FTP: Upload Complete."
}

putlog "ftp uploader by Trixar_za Loaded..."
You could probably modify the above code to suit your needs. If you provide me the relative directories on the shell and website, I can code that in for you.

The above should trigger every minute.
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
madpinger
Voice


Joined: 03 Oct 2010
Posts: 12

PostPosted: Sat Nov 20, 2010 4:13 pm    Post subject: Reply with quote

Trixar_za wrote:
Well, here's some ftp uploader code I wrote for my pisg files, minus the pisg functionality (because it's probably redundant to you):
Code:

#               min hr day month yr
bind time - "*     *   *     *      *" timed:upload

TIME (stackable)
bind time <flags> <mask> <proc>
proc-name <minute> <hour> <day> <month> <year>

Just cause I expect it to be asked Wink
Back to top
View user's profile Send private message
blake
Master


Joined: 23 Feb 2009
Posts: 201

PostPosted: Tue Nov 23, 2010 8:58 am    Post subject: Reply with quote

Have tried the above script still not doing anything do my eggy need to have anything else added to it for this to work correctly

Also what permissions need to be set on the web directory its currently set to 755 also should the directory be creayed in public_ftp or in a home directory

Had this error on typing !upload

Code:

Tcl error [command:upload]: couldn't execute "/usr/bin/ftp": no such file or directory

_________________
Blake
UKEasyHosting UKStormWatch
Back to top
View user's profile Send private message Visit poster's website
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Sun Nov 28, 2010 7:19 am    Post subject: Reply with quote

Try replacing:
Code:
set ftp [open "|/usr/bin/ftp -n $daFTPsite" w]
with
Code:
set ftp [open "|ftp -n $daFTPsite" w]
I know some *nix distros have a weird placement of the ftp command.
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber