LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Tar giving me errors (https://www.linuxquestions.org/questions/linux-newbie-8/tar-giving-me-errors-829897/)

jmc1987 09-02-2010 03:33 AM

Tar giving me errors
 
Hello!

First off I would like to say sorry for not being able to research this down to the fix due to me haveing dial up eh!

Okay now my issue. I am trying backup my whole system befor I do massive changes and I am getting some issues.

System specs
-----------------
Ubuntu 9.04 x84_64
4GB Ram
AMD Athlon(tm) 64 X2 Dual Core Processor 5600+

Okay here is the issue. When I run the command
Code:

james@james-desktop:/media/disk$ sudo tar -cvpzf backup.tar.gz --exclude=/media --exclude=/proc --exclude=/mnt --exclude=/dev --exclude=/lost+found  --exclude=/sys /
It start archiving everything and when I get the end I get an error that says..
Quote:

tar: Error exit delayed from previous errors
So I tried to check all my error and output onto a file by typinging
Quote:

james@james-desktop:/media/disk$ sudo tar -cvpzf backup.tar.gz --exclude=/media --exclude=/proc --exclude=/mnt --exclude=/dev --exclude=/lost+found --exclude=/sys / > output 2> error
bash: output: Permission denied
I get a permission denied. So now I am not sure why I am getting that now so I check


Code:

sudo visudo
Quote:

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

Which shows that sudo is setup right far as I can tell.

Quote:

james@james-desktop:~$ cat /etc/group |grep admin
lpadmin:x:106:james
admin:x:121:james

<More entries are listed in the file>
So here are the questions. How do I stop that error and why is it not allowing me to use the > and 2> options with it?

Thanks

linuxlover.chaitanya 09-02-2010 03:52 AM

Read this link. http://ubuntuforums.org/showthread.php?t=35087
This link talks about the same what you are trying to achieve. And according to the link:
Quote:

At the end of the process you might get a message along the lines of 'tar: Error exit delayed from previous errors' or something, but in most cases you can just ignore that.

jmc1987 09-02-2010 04:40 AM

Hmm wonder how come I didn't fine that forum.

Okay so the error really doesn't mean my archive broke. otherwise ignore it.

but what about my 2nd question. I don't understand why it is denying me to use the > output 2> error commands.

linuxlover.chaitanya 09-02-2010 04:50 AM

What do you exactly want to do? Just log the tar command? Use redirect operand ">>" to a file that you know exists and you got permissions to write to it.

tar -cjvf blah blah >> /tmp/tar.log

skola 09-03-2010 07:38 AM

I know tar should have no problem backing up a whole system's pile of Gbs certainly under a powerful spec'd PC.

Even with plenty space, one big file is somewhat unwieldy. I would tend to do each directory and then it's simpler if you only need to restore from that.

I notice you exclude certain dirs from the big file but do you do them seperately?
I ask because when I do backup it's not from the booted hdd so I see that some of those supposedly self-refreshers still have sub-dirs, so I back them all up.

I do this. with my cursor being at the root of the hdd being backed up.
NB. (leaving out compression and backup medium for clarity)

tar --no-recursion -cvf basedirs.tar * gives me the whole dir base structure and any files in the / root dir.

tar -cvf bsbin.tar bin
tar -cvf bsetc.tar etc

and continuing on down, usually breaking up /usr into 3 seperates.

Makes lfe less complex for me anyway. :)


All times are GMT -5. The time now is 07:45 PM.