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.

help wanted by sendftp.tcl commands

Old posts that have not been replied to for several years.
Locked
C
Capi-lisa
Voice
Posts: 8
Joined: Mon Aug 23, 2004 7:22 am
Location: Belgium
Contact:

help wanted by sendftp.tcl commands

Post by Capi-lisa »

hi


here's a example of the sendftp.tcl

Code: Select all

#
# Sendftp v1.01 (12/6/97) by Ernst <ernst@studbox.uni-stuttgart.de>
# Ernst's eggdrop page:  http://www.sodre.net/ernst/eggdrop/
# =============================================================================

# This is a proc to send a file via FTP to another server. Useful in many
# situations, for example to upload a HTML file generated by eggdrop to your
# www server if it is not the same as your eggdrops machine.

# Change this to something to use to check if a host is alife.
# set pingcheck "" to disable this checking.
# "/bin/ping -c 1" works on Linux. Try just "/bin/ping" on other machines
# Set to "" to disable this checking
set pingcheck "/bin/ping -c 1"

# Include it with 'source scripts/sendftp.tcl'.  Call it with all parameters:
#
#   sendftp <localfile> <server> <user> <password> <remotefile>
#
# 'localfile' and 'remotefile' *must* both be given as FULL paths to the
# filenames, the first on the local, the second	on the remote server.
#
# For example:
#
# sendftp /home/bill/stats.htm www.ms.com bill secret /bgates/WWW/stats.htm
#             (local-file       server    user  pass       remote-file)

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 works but the problem is that he do it 1 time and the stop


what i want is


1) a trigger like !update or /msg bot update so he will send it

2) automatic (every hour for example) that u upload the file



Can Someone help me
P
PsychoO
Voice
Posts: 2
Joined: Thu Jul 21, 2005 3:06 pm

Post by PsychoO »

I can help u mate ;)

Put this in:
# MM HH D M Y
bind time - "00 00 * * *" sendftp
bind time - "30 00 * * *" sendftp
bind time - "00 01 * * *" sendftp
bind time - "30 01 * * *" sendftp
bind time - "00 02 * * *" sendftp
bind time - "30 02 * * *" sendftp
bind time - "00 03 * * *" sendftp
bind time - "30 03 * * *" sendftp
bind time - "00 04 * * *" sendftp
bind time - "30 04 * * *" sendftp
bind time - "00 05 * * *" sendftp
bind time - "30 05 * * *" sendftp
bind time - "00 06 * * *" sendftp
bind time - "30 06 * * *" sendftp
bind time - "00 07 * * *" sendftp
bind time - "30 07 * * *" sendftp
bind time - "00 08 * * *" sendftp
bind time - "30 08 * * *" sendftp
bind time - "00 09 * * *" sendftp
bind time - "30 09 * * *" sendftp
bind time - "00 10 * * *" sendftp
bind time - "30 10 * * *" sendftp
bind time - "00 11 * * *" sendftp
bind time - "30 11 * * *" sendftp
bind time - "00 12 * * *" sendftp
bind time - "30 12 * * *" sendftp
bind time - "00 13 * * *" sendftp
bind time - "30 13 * * *" sendftp
bind time - "00 14 * * *" sendftp
bind time - "30 14 * * *" sendftp
bind time - "00 15 * * *" sendftp
bind time - "30 15 * * *" sendftp
bind time - "00 16 * * *" sendftp
bind time - "30 16 * * *" sendftp
bind time - "00 17 * * *" sendftp
bind time - "30 17 * * *" sendftp
bind time - "00 18 * * *" sendftp
bind time - "30 18 * * *" sendftp
bind time - "00 19 * * *" sendftp
bind time - "30 19 * * *" sendftp
bind time - "00 20 * * *" sendftp
bind time - "30 20 * * *" sendftp
bind time - "00 21 * * *" sendftp
bind time - "30 21 * * *" sendftp
bind time - "00 22 * * *" sendftp
bind time - "30 22 * * *" sendftp
bind time - "00 23 * * *" sendftp
bind time - "30 23 * * *" sendftp


If u put this in it will send it up to the ftp every 30 min.
Psycho Hosting.
I Make The World Free!
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

don't bump ancient posts, at least not with such naive and incorrect stuff
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

And besides thats a dumb way of doing that. All those binds are not needed. I suggest you read up on TCL a little more before deciding on helping others.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Locked