General discussion


delete old files from windows thru unix script

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

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. I think I have to use windows ftp command to delete files. what command can I use to delete files older than 60 days?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Related Discussions

Related Forums