From owner-freebsd-chat Tue Mar 12 23:48:36 2002 Delivered-To: freebsd-chat@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id A462437B400 for ; Tue, 12 Mar 2002 23:48:33 -0800 (PST) Received: from hades.hell.gr (patr530-a210.otenet.gr [212.205.215.210]) by mailsrv.otenet.gr (8.12.2/8.12.2) with ESMTP id g2D7mUuO015192; Wed, 13 Mar 2002 09:48:31 +0200 (EET) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.2/8.12.2) with ESMTP id g2D7mUfb027244; Wed, 13 Mar 2002 09:48:30 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from charon@localhost) by hades.hell.gr (8.12.2/8.12.2/Submit) id g2D7mTIS027243; Wed, 13 Mar 2002 09:48:29 +0200 (EET) (envelope-from keramida@freebsd.org) X-Authentication-Warning: hades.hell.gr: charon set sender to keramida@freebsd.org using -f Date: Wed, 13 Mar 2002 09:48:29 +0200 From: Giorgos Keramidas To: Nathan Mace Cc: freebsd-chat@freebsd.org Subject: Re: backups of log files Message-ID: <20020313074829.GC375@hades.hell.gr> References: <200203130057.TAA27975@uce55.uchaswv.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200203130057.TAA27975@uce55.uchaswv.edu> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 2002-03-12 19:53, Nathan Mace wrote: > how can i get it name them backup1.tar or name > them after the date like 1102.tar for january 1st 2002?? conceptually i can > list lots of ways to do this, but i guess what i'm asking for is sample perl > code. i can't seem to find anything that does this in the usual places i > look. thanks You will probably want to have the day of month and month to have two digits, later on. As others have pointed out -questions is the best place for general FreeBSD questions, but here's a snippet that you might find interesting: use POSIX; $s = strftime("%d.%m.%Y", localtime()); print "$s\n"; Giorgos Keramidas FreeBSD Documentation Project keramida@{freebsd.org,ceid.upatras.gr} http://www.FreeBSD.org/docproj/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message