find /home/httpd/backup/ -mtime +5 -exec rm -f {}; 이 안먹힙니다
글쓴이: DefaultX / 작성시간: 수, 2006/01/18 - 11:07오전
5일 이전의 파일들을 삭제하려고 하는 코드입니다만 에러가 나면서 실행이 되질 않네요
어디가 잘못된걸까요?
[root@www backup]# find /home/httpd/backup/ -mtime +5 -exec rm -f {}; find: missing argument to `-exec'
이렇게 하면 될것 같은데... ㅠ.ㅠ
[root@www backup]# find --help Usage: find [path...] [expression] default path is the current directory; default expression is -print expression may consist of: operators (decreasing precedence; -and is implicit where no others are given): ( EXPR ) ! EXPR -not EXPR EXPR1 -a EXPR2 EXPR1 -and EXPR2 EXPR1 -o EXPR2 EXPR1 -or EXPR2 EXPR1 , EXPR2 options (always true): -daystart -depth -follow --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf --version -xdev tests (N can be +N or -N or N): -amin N -anewer FILE -atime N -cmin N -cnewer FILE -ctime N -empty -false -fstype TYPE -gid N -group NAME -ilname PATTERN -iname PATTERN -inum N -ipath PATTERN -iregex PATTERN -links N -lname PATTERN -mmin N -mtime N -name PATTERN -newer FILE -nouser -nogroup -path PATTERN -perm [+-]MODE -regex PATTERN -size N[bckw] -true -type [bcdpfls] -uid N -used N -user NAME -xtype [bcdpfls] actions: -exec COMMAND ; -fprint FILE -fprint0 FILE -fprintf FILE FORMAT -ok COMMAND ; -print -print0 -printf FORMAT -prune -ls Report bugs to <bug-findutils@gnu.org>.
Forums:
[quote][url]http://oops.org/SERVICE/jsbo
----------------------------------------
[자답] 이렇게 하니 되네요..^^
kfmes 님, 감사합니다
이렇게 실행되네요..^^
find /home/httpd/backup -type f ! -mtime -7 -exec rm {} \;
Now Starting ....
; 앞에 \를 빼놓았었다는 얘기군요. ^^
; 앞에 \를 빼놓았었다는 얘기군요. ^^
댓글 달기