I am trying to find files which are created/modified 30 days ago and will archive them. For this i am using Unix Find command. I am able to achieve the requirement with below command line.
find . -type f -mtime +30 -exec basename {} ; | xargs -I file_name echo mv /home/Cyrup/chip/arc_poc/file_name /home/Cyrup/chip/arc_poc/arc/file_name_$(date +%Y%m%d) | ksh
However I would like to perform this task just using find command which i am not able to achieve. I tried to use below:
find . -type f -mtime +30 -exec mv {} /home/Cyrup/chip/arc_poc/arc/{}_`date +%Y%m%d` ;
但是,它没有努力。 这里,如果{}在发现指挥所查明的所有档案中担任地方持有人。 然后,将档案移至Dir档案,重新命名,就错了吗?
Also -mtime is for modified time of the file. Is there any way that we can find files based on creation time of the file. As per my knowledge we do not have any option with find command.
增 编