I am using the below script to find all the files in a folder which are older than 6 hours and delete all those files, but some how I am not getting the required output.
to be prompted on if you want to delete the files or not. As mentioned earlier, I suggest listing the files first (so run your command without executing 'rm') to make sure you're getting your desired output. Am I the only 'xargs' fan in the building? Everyone seems to like '-exec' but I find that to be SLOWER. Anyways just my stink on it.
Thanks for the replies.
I have modified the script instead of removing I am moving the files to archive location.
but when when I am executing I am getting the blow error
find /root/dun/ -type f -name "*.log" -amin +360 -exec mv \sune\dan\;
find: missing argument to `-exec'
And find is moving based on the system time.., do we have any command which will move the file to archive location based on file creation date.
Lol I showed him that in post #9 but he doesn't acknowledge either one of those answers and keeps flipping em back to \. I have asked a few times about the slashes and get no response.