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 foundAny 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...
3 Answers
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/
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.
4I recently got that error too. Turns out I forgot to specify the files to add to the archive:
tar -cf hello.tarAfter I selected the current directory as the files to add, it worked:
tar -cf hello.tar ./*