Write a script that automates tar so the person executing the script always uses the desired options (cvp) and backup destination

Run this command from the terminal just by copy/pasting it and then share the output.
tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
 
Last edited:


Run this command from the terminal just by copy/pasting it and then share the output.

Getting the same error now the previous one

/home/lisa/.gnome2/keyrings/

/home/lisa/.gnome2/keyrings/user.keystore

/home/lisa/.gnome2/keyrings/login.keyring

File/home/lisa/.gnome2/nautilus-scripts/

Net /home/lisa/.gnome2/panel2.d/

Tras/home/lisa/.gnome2/panel2.d/default/ /home/lisa/.gnome2/panel2.d/default/launchers/

/home/lisa/.bash_logout

Mu/home/lisa/Templates/

Pict/home/lisa/.xauth6vyTL2 Vid/home/lisa/.pulse-cookie

Dov/home/lisa/Pictures/

/home/lisa/.esd_auth

/home/Danish/

/home/Danish/.mozilla/

/home/Danish/.mozilla/plugins/ /home/Danish/.mozilla/extensions/

/home/Danish/.bash_history

/home/Danish/.bashrc

/home/Danish/.bash_profile

/home/Danish/.gnome2/

/home/Danish/.bash logout

tar: Exiting with failure status due to previous errors
 
If you can't run that line without errors it means it's a permission problem, what happens when you run this as a normal user?
Code:
tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz $HOME
Can you you share the output of that? What you previously shared seems like you didn't directly copy/paste because I find it strange looking output.
 
If you can't run that line without errors it means it's a permission problem, what happens when you run this as a normal user?
Code:
tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz $HOME
Can you you share the output of that? What you previously shared seems like you didn't directly copy/paste because I find it strange looking output.
This one I haven't tried I have tried this one yet

tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
 
If you can't run that line without errors it means it's a permission problem, what happens when you run this as a normal user?
Code:
tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz $HOME
Can you you share the output of that? What you previously shared seems like you didn't directly copy/paste because I find it strange looking output.

Lemme try this one
 
Lemme try this one

This is output I am getting it

[root@localhost tabish] # tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz $HOME ttar: Removing leading / from member names


/root/

/root/.cshrc

/root/.gconfd/

/root/.gconfd/saved_state

/root/.gconfd/saved_state.tmp

/root/install.log.syslog

/root/.xauthP3d0ec

/root/.tcshrc

/root/.gnupg/

/root/.gnupg/pubring.gpg

/root/.gnupg/secring.gpg

/root/.gnupg/gpg.conf /root/install.log

/root/.xauthOQJUEy

/root/.bash_history /root/.config/

/root/.config/ibus/

/root/.config/ibus/bus/

/root/.gconf/

/root/.xauthvjYXif

/root/.dbus/

/root/.dbus/session-bus/

/root/.dbus/session-bus/ccc875239584a996c824798c0000000b-0

/root/.bashrc /root/anaconda-ks.cfg

/root/.xauthcSBg6z

/root/.bash_profile

/root/.viminfo

/root/.xauthsNit02

/root/tabish

/root/.xauthYBMAEV /root/.xauthIXBMoZ

/root/.gnome2/

/root/.gnome2/accels/

/root/.gnome2/accels/SELinu Management Tool

/root/.gnome2/SELinux Management Tool

/root/.xauth7XqpSA

/root/.bash_logout

/root/.gnome2 private/
 
Let's try something different this is not helping, can you run the following as root and then share the output.
Code:
tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home &> /dev/null
echo $?
 
Let's try something different this is not helping, can you run the following as root and then share the output.
Code:
tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home &> /dev/null
echo $?

[root@localhost tabish]# tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz &> /dev/null
[root@localhost tabish]# echo $?
2
 
[root@localhost tabish]# tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz &> /dev/null
[root@localhost tabish]# echo $?
2
I made a type it should have been this.
Code:
tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home &> /dev/null
echo $?
 
I made a type it should have been this.
Code:
tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home &> /dev/null
echo $?
Same output

[root@localhost tabish]# tar -cvpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home &> /dev/null
[root@localhost tabish]# echo $?
2
 
Let's try it without verbose mode, run this as root and share the output.
Code:
tar -cpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
 
Let's try it without verbose mode, run this as root and share the output.
Code:
tar -cpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home

[root@localhost tabish]# tar -cpzf /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
tar: Removing leading / from member names
tar: /home/tabish/.gvfs: Cannot stat: Permission denied
tar: Exiting with failure_status due to previous errors
 
This directory or file systeems to be the problem, can you share the output of this.
Code:
ls -la /home/tabish | grep .gvfs
 
This directory or file systeems to be the problem, can you share the output of this.
Code:
ls -la /home/tabish | grep .gvfs

[root@localhost tabish]# ls -la /home/tabish | grep .gvfs
ls: cannot access /home/tabish/.gvfs: Permission denied ?
d??????????? ? ? ? ? ? .gvfs
 
Try running this now and share the output.
Code:
tar -cpzf --exclude=".gvfs" /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
 
Try running this now and share the output.
Code:
tar -cpzf --exclude=".gvfs" /var/backup/3-Wed-20211103-fullbackup.tar.gz /home

[root@localhost tabish]# tar -cpzf --exclude-.gvfs" /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
tar: Removing leading / from member names
tar: /home/tabish/--exclude-.gvfs: file changed as we read it
tar: /home/tabish/.avfs: Cannot stat: Permission denied
tar: Exiting with failure status due to previous errors
 
No you made a type not - but = so that it looks like this.
tar -cpzf --exclude=".gvfs" /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
 
No you made a type not - but = so that it looks like this.

Same error

[root@localhost tabish]# tar -cpzf --exclude=".gvfs" /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
tar: Removing leading / from member names
tar: /home/tabish/--exclude-.gvfs: file changed as we read it
tar: /home/tabish/.avfs: Cannot stat: Permission denied
tar: Exiting with failure status due to previous errors
 
Try this and share the output.
Code:
tar -cpzf --exclude=/home/*/.gvfs  /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
 
Try this and share the output.
Code:
tar -cpzf --exclude=/home/*/.gvfs  /var/backup/3-Wed-20211103-fullbackup.tar.gz /home

[root@localhost tabish]# tar -cpzf --exclude=/home/*/.gvfs /var/backup/3-Wed-20211103-fullbackup.tar.gz /home
tar: Removing leading / from member names
tar: (child): --exclude=/home/*/.gvfs: Cannot open: No such file or directory
tar: (child): Error is not recoverable: exiting now
tar: --exclude=/home/*/.gvfs: Wrote only 4096 of 10240 bytes
tar: Error is not recoverable: exiting now
 

Members online


Top