Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tar: Cowardly refusing to create an empty archive

Tags:

linux

tar

fedora

I use the following tar command to try to backup my entire file system

tar -cvpzf test/backup.tar.gz --exclude=/test

And I receive the following error message

tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.

Can somebody point me in the right direction as to how to use tar and explain why it's trying to create an empty archive?

like image 303
Nicole Louise Avatar asked Jun 06 '17 01:06

Nicole Louise


People also ask

How do I create an empty tar file?

Append will create the tar file if it doesn't already exist, so you don't need to check if it's the first file, just append and if it's the first file tar will create it.

What tar flag is used to create archives?

The tar command writes archives using the specified value of the Blocks parameter only when creating new archives with the -c flag.


1 Answers

You defined what to exclude, but didn't define what you actually want in the archive. Supply at least one path. If you want entire filesystem, then tar -c....... /

like image 189
viraptor Avatar answered Oct 16 '22 13:10

viraptor