|
SnakeBite34
|
SnakeBite34
|
Would it be possible for someone to say, remove lines in their logs automatically? Recently, I tested with this command:
//write -ds*split C:\Martin\MIRC\Logs\ $+ $chan $+ . $+ $network $+ . $+ $date $+ .log
but it doesn't work, since the dates for the log files don't have slashes on them. This is what was returned after trying it:
/write: unable to open 'C:\Martin\MIRC\Logs\#fjdskfldsfds.irchighway.04\08\2005.log'
How would I make it such that it wouldn't have the \ marks when I use the command? My harddrive space is quite limited so I'm trying to cut down on useless consumption in logs.
Thanks in Advance, -SnakeBite
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
You might try this instead For the command line: //write -ds*split $+($logdir,$chan,.,$network,.,$date(dd),/,$date(mm),/,$date(yyyy),.log)
For a script remove the // in front of write
|
|
|
|
SnakeBite34
|
SnakeBite34
|
I just tried that right now. I wrote *split in, then tested your command. This is what came out:
/write: unable to open 'C:\MARTIN\MIRC\logs\#fdsfds.irchighway.05\08\2005.log'
however, I tried it this way:
//write -ds,*split $+($logdir,$chan,.,$network,.,$date(yyyy),$date(mm),$date(dd),.log)
It seems to be "working", to some extent. However, it's not deleting the lines with *split in them. I experimented using -dstest , and it seems that it's not working somehow. :\
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
Make sure that the format of the filenames in your log directory match the format that we're trying to use. I just looked at mine, and noted that in my case the code would have to read write -dw $+ *split $+($logdir,$network,\,$chan,.,$date(yyyy),$date(mm),$date(dd),.log) If you're going to use an * in your search (as a wildcard), then you have to use the w to show that it's a wildcard search, rather than the s
|
|
|
|
Joined: Apr 2003
Posts: 701
Hoopy frood
|
Hoopy frood
Joined: Apr 2003
Posts: 701 |
$date is flexible, you can put it in one call, even if there are dots or slashes or colons between the fields:
//write -ds,*split $+($logdir,$chan,.,$network,.,$date(yyyymmdd),.log)
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
Kelder, that should be -dw, right?
|
|
|
|
SnakeBite34
|
SnakeBite34
|
$date is flexible, you can put it in one call, even if there are dots or slashes or colons between the fields:
//write -ds,*split $+($logdir,$chan,.,$network,.,$date(yyyymmdd),.log) I tried this one with -dw and it seems that that's not working either. It doesn't seem to be deleting anything.
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
Looks like there was another typo in it. Here you are:
//write -dw $+ *split $+($logdir,$chan,.,$network,.,$date(yyyymmdd),.log)
|
|
|
|
Joined: Apr 2003
Posts: 701
Hoopy frood
|
Hoopy frood
Joined: Apr 2003
Posts: 701 |
I have no idea, I only changed the $date stuff  I try to keep away from /write and his buddies...
|
|
|
|
SnakeBite34
|
SnakeBite34
|
Looks like there was another typo in it. Here you are:
//write -dw $+ *split $+($logdir,$chan,.,$network,.,$date(yyyymmdd),.log) Thank you, that works great Edit: I tried to make the script such that it would do it automatically, however, it seems it's uneffective. Here's what I wrote: on 1:QUIT: { //write -dw $+ "*net *split" $+($logdir,$chan,.,$network,.,$date(yyyymmdd),.log) //write -dw $+ " $+ $nick has quit IRC" $+($logdir,$chan,.,$network,.,$date(yyyymmdd),.log) } on 1:JOIN:#: { //write -dw $+ " $+ $nick has joined $chan $+ " $+($logdir,$chan,.,$network,.,$date(yyyymmdd),.log) } on 1:MODE:#: { //write -dw $+ " $+ $nick sets mode" $+($logdir,$chan,.,$network,.,$date(yyyymmdd),.log) } Thanks in Advance, -Snake P.S. Yes, I know I suck at this stuff, :\
Last edited by SnakeBite34; 05/08/05 09:59 PM.
|
|
|
|
|