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.

A script that runs once every hour

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

Post by daplaya »

Here's what I want to do.
I want to upload a *.html file with sendftp.tcl once/hr
But I'm having with problems with the timer script, I want it to call this 1/h

sendftp <localfile> <server> <user> <password> <remotefile>

Can u help?
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

Code: Select all

if {[lsearch -glob [timers] "* timer:sendftp *"] == -1]} { timer 60 timer:sendftp }

proc timer:sendftp {} {
  sendftp <localfile> <server> <user> <password> <remotefile> 
  if {[lsearch -glob [timers] "* timer:sendftp *"] == -1]} { timer 60 timer:sendftp }
}
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

thats the old fasioned way of doing it. using 'bind time' is more efficient
d
daplaya

Post by daplaya »

Thanks wcc, I haven't had the chance to try it yet cause my shell provider seems to be down atm :sad:

About "the new way", I read some about bind time and I want to know if this looks ok:

Code: Select all

bind time - "56 * * * *" time:sendftp

proc time:sendftp {} {
  sendftp etc. 
}
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

No, you need to specify arg's for the proc (or just use 'args').

Code: Select all

bind time - "56 * * * *" time:sendftp

proc time:sendftp {args} {
  sendftp etc. 
}
d
daplaya

Post by daplaya »

Yeah, I discovered that when I tried to run it, thanks anyway :smile:
Locked