From: peter@nmti.com (Peter da Silva)
Subject: Re: using find command to select files to backup
Date: 2000/07/19 [thread overview]
Message-ID: <8l46l0$htq@web.nmti.com> (raw)
In-Reply-To: 8l3rme$prp$1@power25t.hkbu.edu.hk
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1432 bytes --]
In article <8l3rme$prp$1@power25t.hkbu.edu.hk>,
Pui Ming WONG <s11976@net2.hkbu.edu.hk> wrote:
> I would like to backup files whose name meeting certain criteria
> onto 1 tar file from the /var/spool/mail
> directory using the piping feature in unix command.
> I've tried commands like:
> cd /var/spool/mail
> find . -name "[a-z][0-9]*" -print | tar cvf /somedir/somefile.tar -
> find . -name "[a-z][0-9]*" | tar cvf /somedir/somefile.tar -
> But they didn't seem to work
> What should be the command be ?
> The OS is DG Unix 4.0E
If you do a "man tar" on Tru64 UNIX 4.0E, you get this snippet:
R [Compaq] The named file immediately following this option contains a
list of file names separated by newlines. This list is added to (c
function key, r function key) or extracted from (x function key) the
archive. The -R option is incompatible with the -C option.
Try "tar -c -v -f /somedir/somefile.tar -R -". I don't know if -R accepts
stdin like that, if not you can use multiple steps:
find . -name "[a-z][0-9]*" > /tmp/fn$$ &&
tar -c -v -f /somedir/somefile.tar -R /tmp/fn$$ &&
rm -f /tmp/fn$$
(sh, in csh you need to add \ after the &&)
--
In hoc signo hack, Peter da Silva <peter@abbnm.com>
`-_-' Ar rug t� barr�g ar do mhact�re inniu?
'U` "Hint for long-term survival: be tasty, and farmable." -- Tanuki
"And that's the real message of 'The Matrix'." -- Abigail
next prev parent reply other threads:[~2000-07-19 4:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-19 4:00 using find command to select files to backup Pui Ming WONG
2000-07-19 4:00 ` Peter da Silva [this message]
2000-07-20 4:00 ` P.M.Wong
2000-07-26 4:00 ` steven bell
2000-07-28 4:00 ` Mike Mohr
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox