# Note: There is a typo in the online HTML manual; missing f after -c
# I tried the way I have always done "tar cf ..." and the way shown in the
# HTML manual.

mkdir t &&
    cd t &&
    echo foo > bar &&
    sudo chattr +i bar &&
    echo Can make bar immutable &&
    lsattr &&
    # sudo tar cf j.tar --xattrs --xattrs-include=user.* bar &&
    sudo tar --xattrs -cf j.tar bar &&
    mkdir t1 &&
    cd t1 &&
    echo "Cannot restore. Try 4 ways." &&
    sudo tar xf ../j.tar --xattrs --xattrs-include=user.* &&
    lsattr &&
    sudo tar xf ../j.tar --xattrs-include=user.* &&
    lsattr &&
    sudo tar xf ../j.tar --xattrs &&
    lsattr &&
    sudo tar xf ../j.tar &&
    lsattr
~          
As a general comment, I will note that if I do backup (-c) and restore (-x), I 
would expect there would be no differences. Why wouldn't you make that strategy 
the default?


Reply via email to