I remember doing something like this, some time ago though.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
Code: Select all
#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..."
TIME (stackable)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: Select all
# min hr day month yr bind time - "* * * * *" timed:upload
Code: Select all
Tcl error [command:upload]: couldn't execute "/usr/bin/ftp": no such file or directory
Code: Select all
set ftp [open "|/usr/bin/ftp -n $daFTPsite" w]
Code: Select all
set ftp [open "|ftp -n $daFTPsite" w]