Linux

Crontab Shell구동시 에러

애플자라 2013. 11. 12. 13:40
반응형

#!/bin/sh

########################################

# DEV

/usr/bin/find /data/resin-dev/log/ -type f -name access.log.* -mtime +2 -exec rm -f {} \;
/usr/bin/find /data/resin-dev/log/ -type f -name jvm-dev.log.* -mtime +2 -exec rm -f {} \;
/usr/bin/find /data/resin-dev/log/ -type f -name stdout-dev.log.* -mtime +2 -exec rm -f {} \;
/usr/bin/find /home/assetplus2/homepage/logs/ -type f -name assetplus_web_dev.log.* -mtime +2 -exec rm -f {} \;

########################################

# REAL

/usr/bin/find /data/resin-pro-3.1.12/log/ -type f -name access.log.* -mtime +7 -exec rm -f {} \;
/usr/bin/find /data/resin-pro-3.1.12/log/ -type f -name jvm-a.log.* -mtime +2 -exec rm -f {} \;
/usr/bin/find /data/resin-pro-3.1.12/log/ -type f -name stdout-a.log.* -mtime +2 -exec rm -f {} \;
/usr/bin/find /home/assetplus1/homepage/logs/ -type f -name assetplus_web.log.* -mtime +2 -exec rm -f {} \;

########################################

# initech

/usr/bin/find /usr/local/initech/logs/ -type f -name SHTTPService.log.* -mtime +7 -exec rm -f {} \;

########################################

 

구동시 아래와 같은 에러 find: missing argument to '-exec'

 

 

 

해결방법 :

 

DOS mode 로 저장하시여 정상적으로 실행 되지 않았습니다. 

DOS 모드로 저장하시면 시스템에서 제대로 인식하지 못하기 때문에 반드시 UNIX 모드로 저장하여 주시기 바랍니다. 

rm.log.sh 쉘을 UNIX 모드로 변경하여 실행에 문제가 없습니다.

 

 

 

반응형