Why I get "Cowardly refusing to create an empty archive" with TAR command?

I'm trying to follow this tutorial to full backup my linux / Ubuntu 12.04 after a fresh restore.

my code in fullserver.sh:

tar -cvpf /backups/fullbackup.tar --directory=/ --exclude=proc
--exclude=sys --exclude=dev/pts --exclude=backups .

gives after executing ./backups/fullserver.sh the following error:

tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information. 
./backups/fullserver.sh: line 2: --exclude=sys: command not found

Any help to resolve this issue? I read somewhere that I have to remove "/" from the tar line, but I'm not sure that this is true...


Solution 1:

I encountered this warning when trying to execute the command without specifying the zipped file name. For example:

tar -zcvf directoryName

The warning was not issued when I executed this:

tar -zcvf directoryName.tar.gz directoryName/

Solution 2:

The command should be just one line:

tar -cvpf /backups/fullbackup.tar --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=backups .

It seems you've split it into two lines.