Date: Wed, 29 Oct 2003 18:12:16 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Xpression <admin@atenas.cult.cu> Cc: FreeBSD-questions <questions@freebsd.org> Subject: Re: Problem with date... Message-ID: <20031029181216.GA58181@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <002801c39e46$49a3d980$0801a8c0@bloodlust> References: <002801c39e46$49a3d980$0801a8c0@bloodlust>
next in thread | previous in thread | raw e-mail | index | archive | help
--PNTmBPCT7hxwcZjr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Wed, Oct 29, 2003 at 12:58:21PM -0500, Xpression wrote:
> Hi all, I'm logging certain types of files to a daily grouping wi=
th
> the following format `date +%v` and the output format for today is eg.
> 29-Oct-2003, it's fine but this happens at 12:00 pm at night to rotate
> everyday, and I want to check and edit some lines on the file that was
> recorded but date is the actual and date +%v return me the date of today =
and
> not of yesterday, is there a way to recognize the past file ???
You can produce the date formatted as you wish but for 1 day ago by:
% date -v-1d +%v
It's also a good tip when dealing with files with a datestamp in their
name if you use a format more like:
% date +%Y-%M-%d
(ie. 2003-10-29 for today). This has the very useful property that
your directory listing will come out in *date* order.
Cheers,
Matthew
--=20
Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks
Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey Marlow
Tel: +44 1628 476614 Bucks., SL7 1TH UK
--PNTmBPCT7hxwcZjr
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
iD8DBQE/oAMAdtESqEQa7a0RApt5AJ4yazzu5NA+KrkmGhjHc6/KhdDHzACgln2L
38HgG+gH42dF4ayu6Hu/XKg=
=qBms
-----END PGP SIGNATURE-----
--PNTmBPCT7hxwcZjr--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031029181216.GA58181>
