
폴더에서 파일을 삭제하려면 다음 스크립트를 사용하고 있습니다.
script.sh
파일에는 다음 줄만 포함됩니다.
find /usr/filesfolder -type f -iname '*' -mindepth 1 -mtime +1825 -exec rm {} \
Autosys 작업은 항상 다음 오류 출력과 함께 실패합니다.
/usr/scripts/cleanupfiles.sh[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]:
/usr/scripts/cleanupfiles.sh[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]:
/usr/scripts/cleanupfiles.sh[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]:
/usr/scripts/cleanupfiles.sh[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]:
/usr/scripts/cleanupfiles.sh[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]: .[5]:
답변1
find 옵션은 -exec
세미콜론으로 끝나야 하며 쉘에서 이스케이프되어야 합니다.-exec rm {} \;