tar command failing with "Cowardly refusing to create an empty archive"

I just can't understand what is the mistake with the following tar command that complains tar: Cowardly refusing to create an empty archive

tar -c --use-compress-program=pigz -f 107668.tar -C /home/psham/projects/data_dump/2021/1076data 

The folder /home/psham/projects/data_dump/2021/1076data exists & has files in it.

Please could a second pair of eyes help me out of this?

3

1 Answer

Put a . in the end of the command.

The -C tell tar to change its directory before running but without specifying what to archive tar has no idea what to do.

You can read tar cf foo.tar -C bar zar1 zar2 as: create an archive named foo.tar by going to bar folder and archiving zar1 and zar2 files.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like