- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script help!!
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
08-19-2003 04:31 PM
08-19-2003 04:31 PM
can you help me?
after backup 'oracle archive log file' then,
except do not backed up file,delete backed up file
.....
afiedt.buf
arch_0000026778.arc
arch_0000026779.arc
arch_0000026780.arc
arch_0000026781.arc
arch_0000026782.arc
arch_0000026783.arc
arch_0000026784.arc
....
How can I delete from last line(arch_0000026784.arc) to previous 2 or 3 line(arch_0000026782.arc,arch_0000026783.arc)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 05:16 PM
08-19-2003 05:16 PM
SolutionTo do so you can using the touch command to create a file at the moment of time you wish to use as cutoff, see follows:
Script content is as follows:
-------------
touch -t 200308201230 temp
find /arch_dir ! -newer /arch_dir/temp -exec rm {} \;
-------------
This will create temp file and set it's time to Aug 20 12:30 PM, then remove those files NOT newer than the time stamp on temp. Of course you can control this time (using date)to determine the files which you want to remove.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 07:42 PM
08-19-2003 07:42 PM
Re: script help!!
Hope this helps!
-Brian.
#!/bin/sh
myfile=test.txt
count=`wc -l $myfile | awk '{ print $1 }'`
cnt=0
for lines in `cat $myfile`
do
if [ $cnt -eq $count ]
then
echo $lines
else
cnt=`expr $cnt + 1`
echo $cnt
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 11:27 PM
08-19-2003 11:27 PM
Re: script help!!
To remove the tree oldest files:
rm `ls -t *.arc |tail -3`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2003 11:47 PM
08-19-2003 11:47 PM
Re: script help!!
best way, if you use rman, would be to use
"archivelog all delete input;"
in the rman script.
Else, Leif's solution may be the best....
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2003 04:12 PM
08-21-2003 04:12 PM