Hi,
I'm trying to remove the oldest file (whenever there's 14 or more):
I keep getting the following error though:Code:FILECOUNT=`ls | wc -l`; if [ $FILECOUNT > 14 ] then cd "$PATH" && ls -tr | head -n 1 | xargx rm -f; echo "Removed oldest file ..."; else echo "No 14 files in the filesystem yet, nothing to remove"; fi
Can anyone tell me what I'm doing wrong here ?./mysqlbackup: line 1: ls: command not found
./mysqlbackup: line 1: wc: command not found
No 14 files in the filesystem yet, nothing to remove
Thnx in advance !



LinkBack URL
About LinkBacks




CornedBee