Forum Moderators: bakedjake

Message Too Old, No Replies

How to use tar for backing up the entire site...

         

irock

7:36 am on Aug 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, I was wondering how you can use tar command in SSH for backing up files.

I have this in my notepad but SSH rejected.

tar -xvzf backup.tar.gz

Duckula

8:31 am on Aug 29, 2003 (gmt 0)

10+ Year Member



Almost.

$ tar -czvf backup.tar.gz /home/youruser/public_html

or whatever the path should be. First, using -x extracts, not creates a file. Second, you need to specify the path.

Your command is perfect for untarring the resultin file then.

irock

9:11 am on Aug 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh okay... thanks... btw, when I entered this command, I got a message 'Broken pipe' Before that, i saw a GIF file...

Do you know what this means?

Duckula

6:02 pm on Aug 30, 2003 (gmt 0)

10+ Year Member



when I entered this command, I got a message 'Broken pipe' Before that, i saw a GIF file...

Maybe your disk is full. Or you're out of memory.Or by some reason it was not possible to complete the command. From a quick googling (paraphrasing a bit):

A broken pipe means one process finished before another. In this case, it
sounds like gzip aborted before tar could complete.

You can try too to do

$ tar -cvf backup.tar /path/to/directory

and do the compressing later.

Asandir

12:54 am on Sep 1, 2003 (gmt 0)

10+ Year Member



Also, it might spit the dummy if you're trying to tarball a directory which is your cwd (current working directory).

Ie, try creating the tarball of the directory somewhere else...

tar cfvz /home/username/backup.tar.gz /home/username/www

Josk

2:10 pm on Sep 1, 2003 (gmt 0)

10+ Year Member



Perhaps I'm missing something here, but the following is perfectly adequate for me...

tar cvfz - path_to_files > my_files.tar.gz

...though you may be using a different version of tar (this is GNU 1.13.25)

irock

3:53 pm on Sep 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I found out that i need su root access to do this job right. all your commands work flawlessly.

thanks.