- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- strange shell script problem...
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
Discussions
Discussions
Discussions
Forums
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
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 08:20 PM
тАО05-06-2007 08:20 PM
strange shell script problem...
first it writes in one log info1.log and then writes to secong info2.log and then into 3rd.
I wanto to save that logs..becouse once it reaches something like: ~40485796 bytes it starts writeing into second log..then once ir reaches ~40485796 bytes file size it goes to third..
problem is that once it is finished with 3rd log it goes to 1st log and erase old data..I want to keep all those data..
any help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2007 08:28 PM
тАО05-06-2007 08:28 PM
Re: strange shell script problem...
it seems to be a simple, good working 'logrotation'.
You could make a manuell copy of the files that already have reached ~40485796 bytes.
If you want to make this automatically maybe this will help you:
http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2007 08:37 PM
тАО05-06-2007 08:37 PM
Re: strange shell script problem...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2007 08:58 PM
тАО05-06-2007 08:58 PM
Re: strange shell script problem...
maybe you can do this at end of line in the third files.
cat info2.log >> info1.log;cat info3.log >> info1.log
This will make all the log writes to info1.log
And, Since the logs files are pretty big , i suggest you derived input for info2.log and info3.log.
hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2007 09:05 PM
тАО05-06-2007 09:05 PM
Re: strange shell script problem...
Other way is to make another script on cron the logic of which should be to copy and compress the first two log files once the third one is started.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2007 10:26 PM
тАО05-06-2007 10:26 PM
Re: strange shell script problem...
how long does it last to create one log?
I thought about some weeks or months, so you've enough time to copy it!
Your log flies are about 40 MB, this is already a big log file, more would be much more unclear to check.
With the link I gave you, you can define when a file will be copied, so you can make copies to keep those data.
V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-07-2007 07:41 AM
тАО05-07-2007 07:41 AM
Re: strange shell script problem...
When memory was more expensive,
and archiving required human intervention
(e.g. mounting a tape),
this was a convention for archiving mail streams and other queues.
o Maintain 3 logs.
o Reuse the oldest of 3 logfiles.
o Archive the middle of the 3 logfiles.
o Notify the operator to change tapes.
This could theoretically be done with 2 logfiles (active + standby),
but using 3 allowed backup to a slow archive mechanism before a double-high spike in activity exceeded the latest log size.
ksh> TARD=/var/adm/logarchived
ksh> GLOB=/var/adm/logrotate*
ksh> find $GLOB \
> -newer $(ls -t1 "$TARD"|tail +2|head -1) \
> -exec tar {} ';' \
> -exec echo change tape '|' mail wheel ';'
ksh> # operator changes tape and then
ksh> touch "$TARD"
Note that there are no quotes around $GLOB
in the find command.
The find command can be placed in a daily/weekly/... crontab.
The size limit was usually set by the archive media.
The number of logs was set by tradeoff between log memory available and tolerance for spikeness in log growth rate.
The find command triggers when the middle file becomes newer than the last archive acknowledgement,
but must wait until the tar device is available.
Hopefully helpful,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-08-2007 05:41 AM
тАО05-08-2007 05:41 AM
Re: strange shell script problem...
(commands like cat, tail -f etc. see attachment) but this might make it all more messy.
Initially you should check if log rotation and size is configurable in the application/program that generates the logfiles.
Perhaps you easily can select to disable the log rotation and/or put a more reasonable size for your system.
If you disable logrotation you must ensure to have cleanup routines to avoid running out of diskspace.
/Tor-Arne