This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: tar error


On Mon, 19 Jun 2006, Kyle Johnson wrote:

> Hi everyone.
> I'm trying to use tar to setup a cron backup job on one of my systems,
> but I'm getting the following errors:
>
> 1 $ tar -czPf /cygdrive/d/Backups/`date +%m%d%Y`.tgz /cygdrive/c/Shares/dist/*.DBF
> 2     147 [main] tar 2344 C:\cygwin\bin\tar.exe: *** fatal error - fork: can't reserve memory for stack 0x23EBE0 - 0x240000, Win32 error 487
> 3       7 [main] tar 1372 child_copy: stack write copy failed, 0x23EBE0..0x240000, done 0, windows pid 2353940, Win32 error 5
> 4 tar: child process: Cannot fork
> 5 tar: Error is not recoverable: exiting now
>
> The folder /cygdrive/c/Shares/dist/ has ~1,500 DBF files.  I have run a
> similar command on other folders, and did not run into any problems.
> Any ideas?

You are most likely running into command line limits.  I believe this was
fixed in the latest snapshots, so try installing a Cygwin snapshot as
described in <http://cygwin.com/faq/faq.setup.html#faq.setup.snapshots>
and report back to the list whether this fixes the problem for you.

Alternatively, you can do this much more efficiently by piping the list of
arguments to tar from, say, find, rather than relying on the shell
expansion, like this:

find /cygdrive/c/Shares/dist -mindepth 1 -maxdepth 1 -name '*.DBF' -print0 | tar -czPf /cygdrive/d/Backups/`date +%m%d%Y`.tgz --null -T -

This also has the advantage of handling filenames with spaces in them.
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]