Answer by internetuser2008 for Move files to another directory which are...
$ find /sourcedirectory/ -maxdepth 1 -mtime +365 -exec mv "{}" /destination/directory/ \; find: missing argument to `-exec' Correct would be remove ending forward slash from /sourcedirectory/ $ find...
View ArticleAnswer by harleygolfguy for Move files to another directory which are older...
Be careful when using the above solutions, I used them and ended up moving all files in all subfolders!!!! This command moves all files in /source directory and all subfolders under source directory:...
View ArticleAnswer by Pradeep Kanoor for Move files to another directory which are older...
You can use the below command with atime if the files are accessed often find /sourcedirectory -type f -atime +365 -exec mv -t /destinationdirectory {} +;
View ArticleAnswer by cuonglm for Move files to another directory which are older than a...
You can use this command, and specify that you only find for files, not directory, and the file is older than one year find /sourcedirectory -type f -mtime +365 -exec mv "{}" /destination/directory/ \;
View ArticleAnswer by Jenny D for Move files to another directory which are older than a...
You're almost right. -mtime 365 will be all files that are exactly 365 days old. You want the ones that are 365 days old or more, which means adding a + before the number like this -mtime +365. You may...
View ArticleMove files to another directory which are older than a date
I am looking for a solution to move files that are year older from today. My log partition is getting full, but I can not remove them. They are needed for a long long time. Anyway one solution I came...
View Article