- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell script
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
Forums
Discussions
Discussions
Forums
Discussions
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
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
05-06-2007 04:33 PM
05-06-2007 04:33 PM
Prompt how to move from a directory /temp1 to a directory /temp2 files which date of creation will defend from current date more than for 1 month.
ps thankful in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 04:58 PM
05-06-2007 04:58 PM
Re: shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 05:05 PM
05-06-2007 05:05 PM
Re: shell script
To me updating time (mtime) interests, but complexity arose at giving of parametres in mv.
Here that I tried an example:
find /temp1 -mtime +30 -type f | xargs mv /temp2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 05:07 PM
05-06-2007 05:07 PM
Re: shell script
find /temp1 -mtime +30 -type f | xargs -i -n1 mv {} /temp2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 05:16 PM
05-06-2007 05:16 PM
Re: shell script
Usage: mv [-f] [-i] [-e warn|force|ignore] f1 f2
mv [-f] [-i] [-e warn|force|ignore] f1 ... fn d1
mv [-f] [-i] [-e warn|force|ignore] d1 d2
Usage: mv [-f] [-i] [-e warn|force|ignore] f1 f2
mv [-f] [-i] [-e warn|force|ignore] f1 ... fn d1
mv [-f] [-i] [-e warn|force|ignore] d1 d2
//In a directory temp1 find finds 2 files and mv on parametres warrants
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 05:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 05:26 PM
05-06-2007 05:26 PM
Re: shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 05:31 PM
05-06-2007 05:31 PM
Re: shell script
find /temp1 -type f -mtime +30 | xargs -i mv {} /temp2/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 05:39 PM
05-06-2007 05:39 PM
Re: shell script
This variant too works...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 09:15 PM
05-06-2007 09:15 PM
Re: shell script
You can also do with this way.
touch -t 200705070000 timefile
(this will create a file called timefile as below:
-rw-r--r-- 1 root sys 0 May 7 00:00 timefile
)
touch -t 200705071138 timefile
(-rw-r--r-- 1 root sys 0 May 7 11:38 timefile
)
touch -t 200704060000 time2
(-rw-r--r-- 1 root sys 0 Apr 6 00:00 time2
)
You can touch with any date/time you want to use (fine tune according to your needs). Then use those fiels with -newer option of the find.
find . -newer ./time2
Hope this will help you.
Regards,
Rasheed Tamton.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 09:34 PM
05-06-2007 09:34 PM
Re: shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2007 10:35 PM
05-06-2007 10:35 PM