이것은 이전 스크립트에 대한 작은 추가 작업이며 이번에는 백업에 대한 세부 정보를 기록하고 싶습니다.로깅 수은 거래
script /tmp/commit-push-log
# add all files to the repository
for REPOSITORY in [email protected]
do
cd $REPOSITORY
# commit the changes
hg commit -A -m "Commit changes `date`"
# push the changes to the remote repository
if hg push
then
logger hg push completed without failure
else
logger hg push fails
fi
done
exit
cat /tmp/commit-push-log | logger
rm /tmp/commit-push-log
문제는 로그에 아무런 메시지도 표시되지 않는다는 것입니다. 스크립트에서 어떤 점이 잘못 될 수 있습니까?
$ OUTPUT_LOG를 올바르게 인용하지 않았으며 $ REPOSITORY/.hg는 따옴표로 묶지 않았습니다. 'export TMPDIR = "/ tmp/space test"를 시도해보십시오. ./Mykdir "$ TMPDIR"; ./ Your_script' # 내가 의미하는 바를 보자. +1은'tempfile '에 대해 알지 못했다. –