When using tar for backups I'd like to create a separate list of the files that is included in the archive for storing alongside the backup tarball.I also want to be able to store the error messages from tar in a log.Solutions that's not so good:tar --verbose ... &> filelist.txt But this would give errors + file list in one file.tar --list after the tarball has been created. But this takes a long time.Is there some way to get the file list and store it in a separate file at the same time as I'm rolling the ball for the first time?
Is it possible to generate a separate file list when creating a tarball?
bash;backup;tar;io;stdout
This would put the error messages (stderr) in one file and file list (stdout) in one file:$ tar -cvf archive.tar test nonexisting 1> stdout.txt 2> stderr.txt$ cat stdout.txttest/test/05.txttest/06.txttest/00.txttest/01.txttest/10.txttest/07.txttest/03.txttest/02.txttest/04.txttest/08.txttest/09.txt$ cat stderr.txttar: nonexisting: Funktion stat misslyckades: Filen eller katalogen finns intetar: Avslutar med felstatus p grund av tidigare felUsing --index-file as suggested by Johan in the comment to my question would also work good:tar --create \    --verbose \    --index-file=$fileList \    --file $archiveFile \    $filesystemToArchive \    &>> $logFilenameFrom tar manpages:--index-file=FILEsend verbose output to FILE