This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Seek a FTP script

Old posts that have not been replied to for several years.
Locked
d
dj_biboune

Seek a FTP script

Post by dj_biboune »

Hello i am looking for a TCL script for my eggdrop.
I want that this script upload all *.html files in a folders, to an other ftp all the 10 minutes long.
If you have good link ! or that you can codding it, thanx a lot for your help and see you soon :)

( i need you ! )
d
dj_biboune

Post by dj_biboune »

For info, i want this script to upload my meL stats in an other ftp. If meL include lines to make this action, say me where :)
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

I think this, is the one you are searching...
d
dj_biboune

Post by dj_biboune »

thx for this script Kami it works very fine :)
but i want to know, when the file is upload and if we can up all the .html file ?

sendftp /myfolders/*.html

works ?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

np,i think it dont work, maybe you could try:

sendftp /myfolders/1.html
sendftp /myfolders/2.html
sendftp /myfolders/2.html

But you ca try it... sendftp /myfolders/*.html
d
dj_biboune

Post by dj_biboune »

and for my first question ?
when the file is upload ?
d
dj_biboune

Post by dj_biboune »

I have look that the page will be updated when i .rehash my bot.
When can i change the script to up the file all the 10 min long ?

Code: Select all

proc sendftp { localfile server user pass remotefile } {
	global pingcheck
	if {![file exist $localfile]} {
		return "sendftp: File $localfile does not exist."
	}
	if {$pingcheck != ""} {
		if {[catch {exec [lindex $pingcheck 0] [lrange $pingcheck 1 end] $server > /dev/null 2> /dev/null}]} {
			return "sendftp: Machine $server seems to be dead."
		}
	}
	set noftp [catch {set ftpprog [exec which ftd]}] 
	if {$noftp} {
		if {[file executable /usr/bin/ftp]} {
			set ftpprog /usr/bin/ftp
			set noftp 0
		}
		if {[file executable /bin/ftp]} {
			set ftpprog /bin/ftp
			set noftp 0
		}
	}
	if {$noftp} { return "sendftp: You don't seem to have the 'ftp' tool" }
	set pipe [open "|$ftpprog -n $server" w]
	puts $pipe "user $user $pass"
	puts $pipe "bin"
	puts $pipe "put $localfile $remotefile"
	puts $pipe "quit"
	close $pipe
	return 1
}
I past the script if you want to help me and if you havent get it :)
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

amm, i think its something like this:

Code: Select all

bind time "?5 * * * *" sendftp

proc sendftp {args} { 
sendftp /myfolders/file.html
} 
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

]Kami[ wrote:amm, i think its something like this:

Code: Select all

bind time "?5 * * * *" sendftp

proc sendftp {args} { 
sendftp /myfolders/file.html
} 
hmmm? a proc calling itself ? this would cause an endless loop i'd say....

you need to rename the proc that is called by the timer to something else and the call to "sendftp /myfolders/file.html <server> <user> <pass> <remotefile>"
d
dj_biboune

Post by dj_biboune »

Code: Select all

bind time "*5 * * * *" time_sendftp
proc time_sendftp { args } {
sendftp /usr/local/apache2/www/ellmout.net/biboune/ms-dos.html www.expert-gamers.com ms-dos mypass /stats/ms-dos.html
	global pingcheck
	if {![file exist $localfile]} {
		return "File $localfile does not exist."
	}
	if {$pingcheck != ""} {
		if {[catch {exec [lindex $pingcheck 0] [lrange $pingcheck 1 end] $server > /dev/null 2> /dev/null}]} {
			return "Machine $server seems to be dead."
		}
	}
	set noftp [catch {set ftpprog [exec which ftd]}] 
	if {$noftp} {
		if {[file executable /usr/bin/ftp]} {
			set ftpprog /usr/bin/ftp
			set noftp 0
		}
		if {[file executable /bin/ftp]} {
			set ftpprog /bin/ftp
			set noftp 0
		}
	}
	if {$noftp} { return "You don't seem to have the 'ftp' tool" }
	set pipe [open "|$ftpprog -n $server" w]
	puts $pipe "user $user $pass"
	puts $pipe "bin"
	puts $pipe "put $localfile $remotefile"
	puts $pipe "quit"
	close $pipe
	return 1
}
can work ? i have rehash my bot and it doesn't die, but i am not shure that it refreshes my .hmtl all the 5 minutes.
d
dj_biboune

Post by dj_biboune »

Code: Select all

set localfile usr/local/apache2/www/ellmout.net/biboune/ms-dos.html
set server www.expert-gamers.com
set user ms-dos
set pass mypass
set remotefile /stats/ms-dos.html

bind time - * time_sendftp
proc time_sendftp { *5 * * * * } {
	global pingcheck localfile server user pass remotefile
	if {![file exist $localfile]} {
		return "File $localfile does not exist."
	}
	if {$pingcheck != ""} {
		if {[catch {exec [lindex $pingcheck 0] [lrange $pingcheck 1 end] $server > /dev/null 2> /dev/null}]} {
			return "Machine $server seems to be dead."
		}
	}
	set noftp [catch {set ftpprog [exec which ftd]}] 
	if {$noftp} {
		if {[file executable /usr/bin/ftp]} {
			set ftpprog /usr/bin/ftp
			set noftp 0
		}
		if {[file executable /bin/ftp]} {
			set ftpprog /bin/ftp
			set noftp 0
		}
	}
	if {$noftp} { return "You don't seem to have the 'ftp' tool" }
	set pipe [open "|$ftpprog -n $server" w]
	puts $pipe "user $user $pass"
	puts $pipe "bin"
	puts $pipe "put $localfile $remotefile"
	puts $pipe "quit"
	close $pipe
	return 1
}
Doesn't work :x
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

proc time_sendftp { *5 * * * * } {
this is wrong, use any letter instead of the "*" (it has no sense). also the bind should be ?5* because *5 *.. will not only match minutes.
Last edited by Sir_Fz on Sat Nov 15, 2003 5:18 pm, edited 1 time in total.
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

I said then ?5 but like i see he remove ? :P
Locked