*BSD News Article 59502


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!paladin.american.edu!gatech!newsfeed.internetmci.com!howland.reston.ans.net!blackbush.xlink.net!zib-berlin.de!news.tu-chemnitz.de!irz401!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: format for tar date argument?
Date: 12 Jan 1996 23:02:11 GMT
Organization: Private BSD site, Dresden
Lines: 23
Message-ID: <4d6p9j$h7c@uriah.heep.sax.de>
References: <4ccm5m$27f@osprey.unf.edu>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.3

caddy@osprey.unf.edu (Cliff Addy) writes:
> I need to tar a directory tree with only the files modified in the last 
> hour.  I can't figure out the format of the date argument to tar to do
> this.  I've looked at the man page and it doesn't explain it.  I've also
> tried formats from several other commands (e.g. date) and no joy.

Not for tar, but for cpio, one of the possible ways is:

touch -t MMDDhhss /tmp/reference

with MMDDhhss being the reference time, and then

find /dir -newer /tmp/reference -print | cpio -o -Hcrc > /path/archive.cpio

(You could even supply ``-Hustar'' to have cpio generating a tar
archive.)

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)