- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script gzip of oracle archive 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
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
12-04-2001 07:57 AM
12-04-2001 07:57 AM
1) ls -t PROD*.arc >file1 List all .arc files to file1
2) vi file1
3) dd delete first file since I don't want to compress the most recent since it may be in the process of writing.
4)1,$s/PROD/\usr\/contrib\/bin\/gzip PROD/g
insert /usr/contrib/bin/gzip in front of PROD in file1
Would you be so kind as to give an example of the syntax of how to script this in a non-intractive mode?
Thank you,
Robb
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2001 08:01 AM
12-04-2001 08:01 AM
Re: Script gzip of oracle archive files
do
/usr/contrib/bin/gzip ${arcfile}
done
HTH
duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2001 08:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2001 08:28 AM
12-04-2001 08:28 AM
Re: Script gzip of oracle archive files
You could do the following:
DAYSOLD=1
ARCHDIR=/path/to/your/archive/dir
cd $ARCHDIR
find . -name "PROD*.arc" -mtime +$DAYSOLD -exec gzip {} \;
or alternatively:
LEAVENEWEST=1 # the number of arc files to leave uncompressed
ARCHDIR=/path/to/your/archive/dir
cd $ARCHDIR
ls -t PROD*arc > /tmp/listoffiles
NOTARCHED=`cat /tmp/listoffiles | wc -l`
TOBEARCHED=`expr $NOTARCHED - $LEAVENEWEST`
for files in `tail -$TOBEARCHED /tmp/listoffiles`
do
gzip $files
done
good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2001 08:40 AM
12-04-2001 08:40 AM
Re: Script gzip of oracle archive files
Robb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2001 03:19 PM
12-12-2001 03:19 PM
Re: Script gzip of oracle archive files
for arch_log in $arch_dest/*.log ; do
if [ -n "`fuser $arch_log 2>/dev/null`" ] ; then
continue
else
gzip $arch_log
fi
done
Unfortunately, on HP/UX (as opposed to AIX or Solaris), the 'fuser' command is a CPU hog and is therefore, by default, executable for root only. I just get my sysadmin to open it up so the oracle account can run it (and then just make sure your scripts use it judiciously).