| View previous topic :: View next topic |
| Author |
Message |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Sun Sep 17, 2006 6:41 am Post subject: script request [ solved ] |
|
|
Hello guys.
I have a bit of a hard one here so it might challange some of your guru's
I have files in a dir /home/eggdrop/news/
I keep backup files of news.txt once its changed it moved to eg news.lastdateused.txt eg news.091706.txt etc
I was looking for a script that could count up how many files where in that folder but exclute the file news.txt
How hard would that be?
The output should be someing really simple like
<bot> There are 12 backup files in the NEWS archive.
What that be possable?
Cheers guys
Quest
Last edited by whittinghamj on Tue Sep 19, 2006 6:14 pm; edited 1 time in total |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Sun Sep 17, 2006 7:07 am Post subject: |
|
|
try this (not tested)
| Code: | bind pub - !news newsrun
proc newsrun {nick uhost hand chan arg} {
set globres [glob -nocomplain -directory /home/eggdrop/news/ news.*.txt]
puthelp "PRIVMSG $chan : There are [llength $globres] backup files in the NEWS archive"
} |
_________________ <- tcl newb |
|
| Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Sun Sep 17, 2006 3:02 pm Post subject: |
|
|
| it did not work - nothing in the channel and nothing in the dcc window - i have cheked pers and should be fine :-s |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Sep 17, 2006 5:34 pm Post subject: |
|
|
73 posts and you still have not learnt that "It does not work" doesn't work with us.
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Sun Sep 17, 2006 7:29 pm Post subject: |
|
|
Sorry buddy
.set errorInfo
What? You need '.help'
.set errorinfo
What? You need '.help' |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Sep 17, 2006 8:27 pm Post subject: |
|
|
| whittinghamj wrote: | Sorry buddy
.set errorInfo
What? You need '.help'
.set errorinfo
What? You need '.help' |
Then setup your bot to enable it. The forums contain the necessary information. _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Tue Sep 19, 2006 6:05 pm Post subject: |
|
|
hi guys - ok I have it reporting 0 files so its half way working now. just not adding up the files.
Slight change in the requirments. I dont need it it to explude anything now. Just count everything all files. I tried cahnge the news.*.txt to just * but i still get 0 archive files in the privmsg.
Any ideas?
cheers
Jamie |
|
| Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Tue Sep 19, 2006 6:14 pm Post subject: |
|
|
I resolved it - it was an error in the path to file.
thanks |
|
| Back to top |
|
 |
deadite66 Halfop
Joined: 30 May 2005 Posts: 74 Location: Great Yarmouth, UK
|
Posted: Tue Sep 19, 2006 6:27 pm Post subject: |
|
|
\o/ _________________ <- tcl newb |
|
| Back to top |
|
 |
|