General discussion

Locked

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

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?

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Storage Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums