| View previous topic :: View next topic |
| Author |
Message |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Nov 16, 2010 7:57 am Post subject: ftp help required |
|
|
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue Nov 16, 2010 12:06 pm Post subject: Re: ftp help required |
|
|
| 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 |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Nov 16, 2010 2:33 pm Post subject: Re: ftp help required |
|
|
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 |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Fri Nov 19, 2010 11:50 pm Post subject: |
|
|
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 |
|
 |
madpinger Voice
Joined: 03 Oct 2010 Posts: 12
|
Posted: Sat Nov 20, 2010 4:13 pm Post subject: |
|
|
| 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  |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Tue Nov 23, 2010 8:58 am Post subject: |
|
|
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 |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Sun Nov 28, 2010 7:19 am Post subject: |
|
|
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 |
|
 |
|