IT咨询服务tar

tar只备份/目录文件

cd /
df -k|grep -v Mounted|grep -v '/$'|awk '{print $7}'|sed -e 's////g'>fs.txt
ls -A / >root.list
for i in `cat fs.txt`
do
  grep -v "^$i$" root.list >root2.list
  cp root2.list root.list
  rm root2.list
done
>root_file.list
cat root.list|while read i
do
  find "$i" >>root_file.list
done
tar -cvf /lab/root.tar -L root_file.list

注意:
tar 对处理/dev下的设备文件存在问题
参与65

提问者

redliquid
软件架构设计师sms
擅长领域: 存储灾备数据安全

问题状态

  • 发布时间:2009-01-29
  • 关注会员:0 人
  • 问题浏览:32070
  • 最近回答:2011-06-10
  • X社区推广