0
目前我正在做备份mysql数据的bash脚本,唯一的问题是tar
的参数debian
正在工作,但它不能在FreeBSD
上工作。添加到tar后删除文件
是的,我已阅读本: Deleting files after adding to tar archive
答案是,我总是使用上debian
的解决方案 - 我指的是--remove-files
参数。
在FreeBSD上执行以下命令:
tar --remove-files -jcPf $DIR/$Y/$M/$D/mysql-$HOUR.tar.bz2 *.sql
抛出以下错误:
tar: Option --remove-files is not supported
我还没有发现类似--remove-files
PARAM什么。同时阅读man tar
,那么解决方案是什么?
'xargs rm' does not works,it leave the files without remove them。 – Scott
尝试添加-f选项:... | xargs rm -f – ishi