Page 2 of 2 <12
Topic Options
#76913 - 2003-09-29 12:36 AM Re: Enumerate remote files
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
Thnax Lonkero......

It worked..... I was doing a mistake that I was changing the file name too with two @@ (dump ass [Mad] ) now it worked.

now if we go back back to old cord

code:
 
$dt1=@date
$x1 = SubStr($dt1, Len($dt1) - 9, 4)
$x2 = SubStr($dt1, Len($dt1) - 4, 2)
$x3 = SubStr($dt1, Len($dt1) - 1, 2)
$result=$x1 + $x2 + $x3
$sub=Val($result)
$sub1=$sub-7
$dr=Dir("f:\")
While $dr <> "" AND @error = 0
$dt=GetFileTime ("f:\$dr")
? $dr
? $dt
$dttrm=Left("$dt",10)
$y1 = SubStr($dttrm, Len($dttrm) - 9, 4)
$y2 = SubStr($dttrm, Len($dttrm) - 4, 2)
$y3 = SubStr($dttrm, Len($dttrm) - 1, 2)
$result1=$y1 + $y2 + $y3
If ($sub1 > $result1)
;Del "\\mosaic01mz\eventlog\$dr"
;? "less than 7 exist"
EndIf
$DR=Dir()
Loop

I think I have to add that extra "@" to
code:
 $dt=GetFileTime ("f:\$dr") 

here somewhere right ?
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
#76914 - 2003-09-28 05:30 PM Re: Enumerate remote files
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
nope.
the double stuff for @ and $ and % only is effective when you do type it yourself in the scriptfile.
thus, if you read the filename, it will be in the variable and the double thing does not infect it.
but use these lines, as they "follow" best practise:
code:
$dt=GetFileTime ("f:\"+$dr)
? $dr
? $dt
$dttrm=Left($dt,10)

_________________________
!

download KiXnet

Top
#76915 - 2003-09-28 05:59 PM Re: Enumerate remote files
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Saleem,
Like I said in my first post!
quote:
You don't provide enough information.
In your code, you do:
$dt=GetFileTime ("\\server\eventlog\$dr")
? $dt

If you would have said that $dt returns nothing in your first instead of tenth post, we could have solved this with less than 22 posts!

If you cannot learn to provide more details, I will not look at any more of your posts.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#76916 - 2003-09-29 03:14 AM Re: Enumerate remote files
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
A current eventlog can never be older than seven days as it is constantly in use. However, backed-up eventlog can be older than seven days. Now, if you want to delete those eventlogs, then why do you back them up in the first place?

Alos, you cna specify how eventlogs overwriten the evententries, and you can also resize the eventlogsizes to have all events for a specific time period into them.

Thus, as other already repeatedly told you, please explain to us in detail what exactly you try to accomplish.
_________________________
There are two types of vessels, submarines and targets.

Top
#76917 - 2003-09-29 05:48 AM Re: Enumerate remote files
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
LLigetfa
It was not puposefully even I came to know the problem is in GetFiletime() only only when I reach 10th post. As i mentioned in my subject line I thought the problem is with Enumerating remote files.

Any way thanx for your support.

sealeopard

We have some unimportent servers which we are not spending money for backup , hence we decided to keep log files for last seven days by deleting them on weekly basis.
Geographically this servers are located in diffrent regions so I thought of writing a script to connect this servers and deleting event files centrelly.

Lonkero

I'll test the code and post the result.
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
#76918 - 2003-09-29 04:24 PM Re: Enumerate remote files
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
So, you're saying that the eventlogs on those "unimportant" servers are getting so big within a seven-day period, that thet needs to manually be deleted? [Eek!]

Just set "Overwrite events older than 7 days" and set the eventlog file size to e.g. 8192kB and they will purge themselves automatically.
_________________________
There are two types of vessels, submarines and targets.

Top
#76919 - 2003-09-30 06:01 AM Re: Enumerate remote files
Saleem Offline
Hey THIS is FUN
*

Registered: 2001-04-11
Posts: 280
Loc: UAE
This are our test servers, now a days we are doing some extensive application tests on this servers so some how event logs are getting heavy ver fast.

Thanx for the suggestion, good news that script is also working now.
_________________________
“I’ll not change you unless you don’t have intention to change yourself” --H:Quran

Top
Page 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.058 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org