HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: house keeping script
Operating System - HP-UX
1833366
Members
3222
Online
110052
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-25-2010 06:14 AM
05-25-2010 06:14 AM
house keeping script
Hi All,
Greetings & Good day,
I would like to write to script find files which are has been created past 60 mins and move those files to /var/adm/crash/ora
source folder :- /oracle/orarchieve
target folder :- /var/adm/crash/ora
thanks in advance for you kind advice & help
Regards,
Johnson
Greetings & Good day,
I would like to write to script find files which are has been created past 60 mins and move those files to /var/adm/crash/ora
source folder :- /oracle/orarchieve
target folder :- /var/adm/crash/ora
thanks in advance for you kind advice & help
Regards,
Johnson
Problems are common to all, but attitude makes the difference
- Tags:
- find
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2010 06:26 AM
05-25-2010 06:26 AM
Re: house keeping script
Shalom Johnson,
Very interesting.
Here is a trick.
Example
touch -t 200509090900 /tmp/pivotfile
and use find's newer option:
find . type f -newer /tmp/pivotfile
# add -exec mv
Change the names to what you need.
Test thoroughly.
SEP
Very interesting.
Here is a trick.
Example
touch -t 200509090900 /tmp/pivotfile
and use find's newer option:
find . type f -newer /tmp/pivotfile
# add -exec mv
Change the names to what you need.
Test thoroughly.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2010 06:57 AM
05-25-2010 06:57 AM
Re: house keeping script
Hi Johnson:
This should meet your needs:
# cat ./mover
#!/usr/bin/perl
use strict;
use warnings;
use File::Copy;
my $srcdir = qq(/oracle/orarchive);
my $dstdir = qq(/var/adm/crash/ora);
my @files = grep( -f && -M $_ > 3600 / 86400, glob("$srcdir/*") );
for my $file (@files) {
print "Moving $file -> $dstdir\n";
move( $file, $dstdir );
}
1;
...The value of 3600 represents 60-minutes. The value of 86400 is the number of seconds in a day.
Regards!
...JRF...
This should meet your needs:
# cat ./mover
#!/usr/bin/perl
use strict;
use warnings;
use File::Copy;
my $srcdir = qq(/oracle/orarchive);
my $dstdir = qq(/var/adm/crash/ora);
my @files = grep( -f && -M $_ > 3600 / 86400, glob("$srcdir/*") );
for my $file (@files) {
print "Moving $file -> $dstdir\n";
move( $file, $dstdir );
}
1;
...The value of 3600 represents 60-minutes. The value of 86400 is the number of seconds in a day.
Regards!
...JRF...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP