[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: find -mtime -1 | xargs scp ... user@remote:/dest/path



On Sun, Sep 29, 2002 at 08:52:54PM -0700, Alvin Oga wrote:
> On Sun, 29 Sep 2002, will trillich wrote:
> > sadly, there are spaces and apostrophe's (windo~1 files, of
> > course) -- and there's a possibility that the resulting list
> > from the `find` command might overflow the command buffer as
> > well, so the first suggestion is the winner, assuming i can get
> 
> find -type f -mtime -1 | tar cvf /tmp/x.tgz -T -

most delightfully cool! and without a great deal of hair, even.

you'd think i might consider tar after all this time, but noooo.

> scp /tmp/x.tgz user@host:dir && "untar it locally and automatically"
> 	that shouldnt have any problems w/ "windoze's stYLE file names"

but i think you meant (after double-checking the man pages),

	find -type f -mtime -1 -print0 | \
		tar cvf /tmp/$(todaystring).tgz --null -T -

right? don't we still need -print0 and -null for the difficult
(space-inclusive) filenames?

and then i need to figure out the handwaving under "untar it
locally and automatically"... sounds like a fun wheel to invent!
(probably use a minutes-delayed crontab, eh?)

-- 
I use Debian/GNU Linux version 2.2;
Linux server 2.2.17 #1 Sun Jun 25 09:24:41 EST 2000 i586 unknown
 
DEBIAN NEWBIE TIP #103 from Dave Sherohman <esper@sherohman.org>
:
Trying to CREATE A CRONTAB FOR THE LAST DAY OF THE MONTH?  Best
to put all the logic within the crontab itself (a Good Thing,
since you then only have to look in one place to find it):
	1 0 28-31 * * [ "$(date +%d -d +1day)" -eq "1" ] && /path/to/script args

Also see http://newbieDoc.sourceForge.net/ ...



Reply to: