Discussion Locked

delete old files from windows thru unix script

0 helpful
0 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

0 replies

No replies were posted before this discussion closed.

This discussion is closed to new replies.