tar: file changed as we read it

前端 未结 8 1977
你的背包
你的背包 2020-12-02 15:03

I am using make and tar to backup. When executing makefile, tar command shows file changed as we read it. In this case,

8条回答
  •  萌比男神i
    2020-12-02 15:51

    To enhance Fabian's one-liner; let us say that we want to ignore only exit status 1 but to preserve the exit status if it is anything else:

    tar -czf sample.tar.gz dir1 dir2 || ( export ret=$?; [[ $ret -eq 1 ]] || exit "$ret" )
    

    This does everything sandeep's script does, on one line.

提交回复
热议问题