tar: file changed as we read it

前端 未结 8 1992
你的背包
你的背包 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条回答
  •  悲哀的现实
    2020-12-02 15:56

    It worked for me by adding a simple sleep timeout of 20 sec. This might happen if your source directory is still writing. Hence put a sleep so that the backup would finish and then tar should work fine. This also helped me in getting the right exit status.

    sleep 20
    tar -czf ${DB}.${DATE}.tgz ./${DB}.${DATE}
    

提交回复
热议问题