delete old files thru unix script

I have to delete files older than 60 days from a windows directory. So I tried to include this script

FTP_LOG=${DATA_TOP}/data_tmp/logfile
FTP_CMDS=${DATA_TOP}/data_tmp/cmdfile
echo "open ftp1" > ${FTP_CMDS}
echo "user anonymous local" >> ${FTP_CMDS}
echo "cd ${SRC_DIR}" >> ${FTP_CMDS}
echo "find . -mtime +56 -exec rm -f {} \;" >> ${FTP_CMDS}
echo "bye" >> ${FTP_CMDS}
ftp -iv ${SERVER_NAME} < ${FTP_CMDS} > ${FTP_LOG}

But it is not recognizing the find command. I am getting "?Invalid command" error. The command works fine in command line in unix.
any thoughts?

If you are connecting to a Windows server with your ftp, which I assume that you are, you'll have to use Windows commands to search and locate the files that you are looking for. The commands within a ftp session are limited. Google "windows ftp commands" to find a list of them.

Hope this helps.

thanks. couldn't find how to specify to delete files older than 'n' days..

@snair001

The unix command "find" is not available within a ftp session. Some ftp commands have similar syntax to unix commands but when you are in an ftp session you are not in a unix shell. If your only access to the server is an anonymous ftp session it may be advisible to approach the administrator of the server to handle filesystem maintenance tasks.