Answer the question
In order to leave comments, you need to log in
How to archive 70 files from one directory to different archives?
I tried so that through tail -n 70 then skip 70, but:
$ls -l -t test/ | head -70 | tar -cvf archive_2_70.tar.gz
tar: Cowardly refusing to create an empty archive
Answer the question
In order to leave comments, you need to log in
in a pipe there is no way to transfer several separate files / sets of names
. First, you cut your listing into separate files with 70 names in each. you throw it into a frame so as not to force the carrier.
ls -l -t test/ | split -l 70 - /run/user/1000/list
for file in /run/user/1000/list*
do
i++
tar --files-from=$file -cvf /path/to/archive_$i_70.tar.gz
done
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question