egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sendftp for multitple files

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sat Jan 26, 2013 2:35 pm    Post subject: sendftp for multitple files Reply with quote

Can anyone tell me what is wrong with this code? When its tested to upload only 1 file it works ok but whene i make it do add multiple files it fails.

Code:

proc timed:upload {m h d m y} {
   global ftp

   set ftpx [open "|ftp -n $ftp(host)" w]
   puts $ftpx "user $ftp(user) $ftp(pass)"
   puts $ftpx "bin"

   foreach file [lsort [glob -directory $ftp(dir) *]] {

      if { [file readable $file] && [file isfile $file]} {
         puts $ftpx "put $file ${ftp(updir)}${file}"
         putlog "${ftp(updir)}${file}"
      }
   }
   puts $ftpx "quit"
   close $ftpx
   putlog "FTP: all files in $ftp(dir) uploaded successfuly to $ftp(host)"
}

_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber