- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- using the FIND command to move files
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2005 08:40 AM
тАО02-24-2005 08:40 AM
i have a large directory with over 800,000 files in it. I am wanting to move all files older then 30days to another directory. I am trying to use the FIND command, but am not having tons of luck. Any help would be appreciated. This is on a HPUX 11.i server. thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2005 08:44 AM
тАО02-24-2005 08:44 AM
Re: using the FIND command to move files
cd to desired source directory:
find . -mtime +30 -type f -exec mv {} /xxx/yyy/ \;
Before doing this command, I would substitute a "safe" command like ls -l in the -exec clause to get your criteria just right.
find . -time +30 -type f -exec ls -l {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2005 08:45 AM
тАО02-24-2005 08:45 AM
Re: using the FIND command to move files
find . -mtime +30 -exec mv {} /destination \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2005 08:47 AM
тАО02-24-2005 08:47 AM
Re: using the FIND command to move files
touch -t "time_30_days_back" somefile
find /dir -type f ! -newer "somefile" -exec ll -d {} \;
This give list and now move it by adding -exec mv {} /somedir/. or afterwards.
This will also do it.
find /dir -type f -ctime +30 -exec mv {} /somedir/. \;
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2005 08:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-24-2005 09:09 AM
тАО02-24-2005 09:09 AM
Re: using the FIND command to move files
Sorry ... back to what I was going to say ...
several people used different time options in their find command and I wanted to help you understand the differences:
-atime is for the files access time
-ctime is for the files changed time
-mtime is for the files modified time
Play with the command options by using ls rather than mv until you get the desired result. Hope this clears things up.