Code snippetry.
Apr. 16th, 2008 06:34 pmOK. 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:
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.
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.
no subject
Date: 2008-04-16 06:08 pm (UTC)no subject
Date: 2008-04-16 06:42 pm (UTC)no subject
Date: 2008-04-16 08:47 pm (UTC)