LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   tar.gz: Cannot stat: No such file or directory (https://www.linuxquestions.org/questions/linux-newbie-8/tar-gz-cannot-stat-no-such-file-or-directory-901571/)

windstory 09-07-2011 07:01 AM

tar.gz: Cannot stat: No such file or directory
 
I tried to backup my site, but failed.

PHP Code:

tar -zcfp mybackup.tar.gz my-site
tar
tar.gzCannot statNo such file or directory 

What is wrong?

Nylex 09-07-2011 07:16 AM

You need to put the filename directly after the -f option, i.e.

tar -zcpf mybackup.tar.gz my-site

Also, you probably shouldn't use the PHP code tags, since the text is blue and it can be difficult to read against the blue background.

windstory 09-07-2011 08:40 AM

Nylex/ Thanks a lot!
It works!

rishabhbahukhandi 04-14-2020 04:08 AM

Remove - from vcfz options. tar does not need hyphen for options.

With a hyphen, the argument for the -f option is z. So the command is in effect trying to archive dvr_rdk_v1.tar.gz and dvr_rdk into an archive called z. Without the hyphen, the semantics of the options changes, so that the next argument on the command line, i.e. your archive's filename, becomes the argument to the f flag.

Also check your write permission to the directory from which you are executing the command.


All times are GMT -5. The time now is 04:34 AM.