Quantcast
Channel: Move files to another directory which are older than a date - Server Fault
Browsing latest articles
Browse All 6 View Live

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 Article



Answer 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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


Move 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
Browsing latest articles
Browse All 6 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>