mIRC Home    About    Download    Register    News    Help

Print Thread
#126793 05/08/05 03:27 AM
Joined: Aug 2005
Posts: 30
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2005
Posts: 30
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

#126794 05/08/05 04:30 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You might try this instead
For the command line:
Code:
 //write -ds*split $+($logdir,$chan,.,$network,.,$date(dd),/,$date(mm),/,$date(yyyy),.log)
 


For a script remove the // in front of write

#126795 05/08/05 05:04 AM
Joined: Aug 2005
Posts: 30
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2005
Posts: 30
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. :\

#126796 05/08/05 06:18 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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
Code:
 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

#126797 05/08/05 08:12 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
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)

#126798 05/08/05 02:13 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Kelder, that should be -dw, right?


Invision Support
#Invision on irc.irchighway.net
#126799 05/08/05 02:43 PM
Joined: Aug 2005
Posts: 30
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2005
Posts: 30
Quote:
$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.

#126800 05/08/05 02:48 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Looks like there was another typo in it. Here you are:

//write -dw $+ *split $+($logdir,$chan,.,$network,.,$date(yyyymmdd),.log)


Invision Support
#Invision on irc.irchighway.net
#126801 05/08/05 04:20 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
I have no idea, I only changed the $date stuff smile
I try to keep away from /write and his buddies...

#126802 05/08/05 09:11 PM
Joined: Aug 2005
Posts: 30
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2005
Posts: 30
Quote:
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.

Link Copied to Clipboard