F
F
fStrange2013-06-18 11:05:02
Data archiving
fStrange, 2013-06-18 11:05:02

Archiving by size [error]

Tried to archive like this.

find docs/ -size -100k -print | xargs tar -czvf archive.tar.gz


So.

find docs/ -size -100k > target.txt
tar czvpf test.tar.gz -T target.txt


Gives an error "bash: fork: Cannot allocate memory"

I archived the files in a third way, through a php script. But I want to understand.
1) Why is there not enough memory? The target.txt file turned out to be relatively small, less than 1Mb
2) Is the problem solved somehow without php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Akulovich, 2013-06-18
@fStrange

"fork: Cannot allocate memory" is already a lack of memory to just start a new process, and not find / pack. Did you check the free RAM BEFORE executing these commands?

A
AgentSIB, 2013-06-18
@AgentSIB

If there are a lot of files, then try this.

tar cf archive.tar --files-from /dev/null
find docs/ -size -100k -exec tar rf archive.tar {} \;
gzip -9 archive.tar

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question