sobrique: (Default)
[personal profile] sobrique
OK. So if you're anything like me, you occasionally deal with log files.

Sometimes these log files are on systems which don't have anything remotely resembling a real shell.

So, here's a little snippet of usefulness:

for /F "tokens=1-3 delims=/ " %%v in ('date /T') do (
set day=%%v
set month=%%w
set year=%%x)

echo %year%%month%%day%

move D:\Legato\nsr\logs\daemon.log D:\Legato\nsr\logs\daemon.%year%%month%%day%.log



Lets me output a date in a format of YYYYMMDD, which is far more useful than most defaults because you get to sort by filename, in date order.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

sobrique: (Default)
sobrique

December 2015

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728 293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 18th, 2026 07:39 pm
Powered by Dreamwidth Studios