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.

Ftp

Support & discussion of released scripts, and announcements of new releases.
Post Reply
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Ftp

Post by blake »

Hi im using an ftp script on my eggy that i found in the tcl archive however it dont seem to be uploading the files do i have to add any thing else to my eggdrop for it to beable to use ftp scripts

Edit: Restrted my eggdrop getting this error on partyline

PutinFtp.TCL: Uploading
Tcl error in script for 'timer4':
child process exited abnormally

Script below is what im using

Code: Select all

#This Script Upload files (default: two) to ur remote server#
#If u want Upload More Files, Just Add more lines, ex:
#DEFAULT 2:
#set onefile "file1"
#set twofile "file2"
#
#Add More Lines if u want upload more files.
#
#set threefile "file3"
#set fourfile "file4"
# 
#find this line:
#global serverftp ftpuser ftpass sendtime eggpath serverpath onefile twofile
#
#and add this:
#threefile fourfile 
#
#example: global serverftp ftpuser ftpass sendtime eggpath serverpath threefile fourfile
#
#And find this lines:
#puts $wurstbaum "put $eggpath/$onefile $serverpath/$twofile"
#
#and add after it's lines:
#	puts $wurstbaum "put $eggpath/$threefile $serverpath/$threefile"
#	puts $wurstbaum "put $eggpath/$fourfile $serverpath/$fourfile"
#
##########################################################
##########################################################
# Put every x minutes send ur files.
#
set sendtime 1

##########################################################
# Put in ur name file.
#
set onefile "fileone"
set twofile "filetwo"

##########################################################
# Now enter the hostname of the ftp server where upload.
#
set serverftp ""

##########################################################
# Username and Password for the ftp account.
#
set ftpuser ""
set ftpass ""

##########################################################
# Path of your files on your shell
#
set eggpath "/home/ircduser/Gateway/logs/"

##########################################################
# Absolute path of ur remote server FTP
#
set serverpath "/home/chatters/public_html/Logfiles/"

###################################################################
## DONT CHANGE ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING ##
###################################################################

if {[info exists putinftp_running]} {
 timer $sendtime putinftp
 set putinftp_running 1
}

 proc putinftp { } {
	global serverftp ftpuser ftpass sendtime eggpath serverpath onefile twofile
	putlog "PutinFtp.TCL: Uploading"
	set ftpclient [exec which ftp]
	set wurstbaum [open "|$ftpclient -n $serverftp" w]
	puts $wurstbaum "user $ftpuser $ftpass"
	puts $wurstbaum "bin"
	puts $wurstbaum "put $eggpath/$onefile $serverpath/$onefile"
	puts $wurstbaum "put $eggpath/$twofile $serverpath/$twofile"
	puts $wurstbaum "quit"
	putlog "PutinFtp.TCL: Uploaded File"
	close $wurstbaum
        timer $sendtime putinftp
	return 1
}

putlog "4-==PutinFtp.TCL\: v1.0 by Nor7on loaded.==-"

############################################################################
##################################################################
###
###
##            Thats it.
##
#
#Contac: yournick@nor7on.org - Channel: #Madrid - Undernet. web: www.nor7on.org
Last edited by blake on Mon Sep 13, 2010 7:34 am, edited 1 time in total.
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

Maybe try removing the timer $sendtime putinftp line from proc putinftp?

It's kind of weird that a proc is calling itself with a timer within itself. Creates a pretty nasty loop I would imagine.
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

If I remove that will it stop the script sending the files every couple of minutes though as im using it to send room logs to my website

Edit done that but nothing is happening at all now
User avatar
Trixar_za
Op
Posts: 143
Joined: Wed Nov 18, 2009 1:44 pm
Location: South Africa
Contact:

Post by Trixar_za »

You're right. Seems there is a variable missing somewhere.

Add in set putinftp_running 1 just after set serverpath "/home/chatters/public_html/Logfiles/"

Also make if {![info exists putinftp_running]} to if {[info exists putinftp_running]} (just remove the ! basically).

Now it should start the timer when the script is loaded.
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Changed

Code: Select all

if {![info exists putinftp_running]} {
 timer $sendtime putinftp
 set putinftp_running 1
}
To

Code: Select all

if {[info exists putinftp_running]} {
 timer $sendtime putinftp
 set putinftp_running 1
}
Still getting the following error

PutinFtp.TCL: Uploading
Tcl error in script for 'timer1':
child process exited abnormally
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Any one able to help with this or come up with something similar
Post Reply