- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cron to copy and keep it for 1 day
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
Discussions
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
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
06-22-2004 01:33 PM
06-22-2004 01:33 PM
00,15,30,45 * * * * find /oracle/TRP/saparch -name '*arch*dbf' -newer /oracle/TRP/saparchlocal -print -exec cp -p {} /oracle/TRP/saparchlocal \;
00,15,30,45 * * * * find /oracle/TRP/saparch -name 'archTRP.log' -newer /oracle/TRP/saparchlocal/archTRP.log -print -exec cp -p {} /oracle/TRP/saparchlocal \;
0 3,12,20 * * * find /oracle/TRP/saparchlocal -name '*arch*dbf' -mtime +0 -print -exec rm {} \;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2004 01:46 PM
06-22-2004 01:46 PM
Solutionif u try the following:
# find /oracle/TRP/saparchlocal -name '*arch*dbf' -mtime +0 -print -exec ls -ld {} \;
or
# find /oracle/TRP/saparchlocal -name '*arch*dbf' -atime +0 -exec ls -ld {} \;
r there any listing of the archive logs.
just for info, i have no problem using -atime to remove the archive log from my server.
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2004 02:19 PM
06-22-2004 02:19 PM
Re: cron to copy and keep it for 1 day
find /oracle/TRP/saparchlocal -name '*arch*dbf' -mtime +0 -print -exec ls -ld {} \;
/oracle/TRP/saparchlocal/TRParch1_2413.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 04:31 /oracle/TRP/saparchlocal/TRParch1_2413.dbf
/oracle/TRP/saparchlocal/TRParch1_2414.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 07:31 /oracle/TRP/saparchlocal/TRParch1_2414.dbf
/oracle/TRP/saparchlocal/TRParch1_2415.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 07:34 /oracle/TRP/saparchlocal/TRParch1_2415.dbf
/oracle/TRP/saparchlocal/TRParch1_2416.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 07:37 /oracle/TRP/saparchlocal/TRParch1_2416.dbf
/oracle/TRP/saparchlocal/TRParch1_2417.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 09:11 /oracle/TRP/saparchlocal/TRParch1_2417.dbf
/oracle/TRP/saparchlocal/TRParch1_2418.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 10:06 /oracle/TRP/saparchlocal/TRParch1_2418.dbf
find /oracle/TRP/saparchlocal -name '*arch*dbf' -atime +0 -exec ls -ld {} \;
-rw-rw---- 1 oratrp dba 41944064 Jun 22 04:31 /oracle/TRP/saparchlocal/TRParch1_2413.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 07:31 /oracle/TRP/saparchlocal/TRParch1_2414.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 07:34 /oracle/TRP/saparchlocal/TRParch1_2415.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 07:37 /oracle/TRP/saparchlocal/TRParch1_2416.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 09:11 /oracle/TRP/saparchlocal/TRParch1_2417.dbf
-rw-rw---- 1 oratrp dba 41944064 Jun 22 10:06 /oracle/TRP/saparchlocal/TRParch1_2418.dbf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2004 02:49 PM
06-22-2004 02:49 PM
Re: cron to copy and keep it for 1 day
could u just perform the purging by replace "ls -ld" with rm without using cron for now, i.e.:
# find /oracle/TRP/saparchlocal -name '*arch*dbf' -atime +0 -exec rm {} \;
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2004 03:18 PM
06-22-2004 03:18 PM
Re: cron to copy and keep it for 1 day
Why you are trying to copy the archive log files.
IF you need such a scneario then you can add a parameter in the Oracle database initialization file.
LOG_ARCHIVE_DUPLEX_DEST
Then you can remove those files from the specified directory using a script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2004 03:34 PM
06-22-2004 03:34 PM
Re: cron to copy and keep it for 1 day
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2004 05:57 PM
06-22-2004 05:57 PM
Re: cron to copy and keep it for 1 day
Did you try Joseph's suggestion to remove the files with the same command from the commandline, so not using cron? Result?
Some other suggestions:
* Do you receive any emails from cron jobs failing?
* Whose cron job is it? Whose directory is it, what are the permissions on the directory?
* Can you try rm -f in stead of rm?
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2004 07:35 PM
06-22-2004 07:35 PM
Re: cron to copy and keep it for 1 day
you could try first to make sure that there are files to delete, e.g. by this command:
# find /oracle/TRP/saparchlocal -name '*arch*dbf' -mtime +0 -print -exec ls -ltr {} \;
If no file appears then try this:
# set -x
and execute the command again in order to see how the wildcards expand: perhaps they do not match anything.
It would also be a good idea to redirect the output from the cron commands to specific files. If not, the output from the cron commands goes to the mail for the user in whose crontab the commands are executed - hence Jeroen's suggestion.
regards,
John K.