- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to archive syslog.log
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-03-2008 05:10 AM
06-03-2008 05:10 AM
This is not a log rotation question. I wonder if anybody has a procedure in place to rename the OLDsyslog.log after reboot and copy it to a different location for a special backup?
Any other ideas?
Thank you,
Elena.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2008 05:18 AM
06-03-2008 05:18 AM
Re: How to archive syslog.log
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2008 05:20 AM
06-03-2008 05:20 AM
Re: How to archive syslog.log
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2008 05:21 AM
06-03-2008 05:21 AM
Re: How to archive syslog.log
This is simple. Create yourself a simple startup script that runs at run-level 3 --- well after the 'syslog' is moved to 'OLDsyslog'.
See the manpages for 'rc(1M)' for the details of the requirements for a startup script. You don't need a shutdown script for your purposes here.
Use '/sbin/init.d/template' as your script template.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2008 05:28 AM
06-03-2008 05:28 AM
Re: How to archive syslog.log
I use an "inittasks" script
( /sbin/rc2.d/K001inittasks -> /sbin/init.d/inittasks )
( /sbin/rc3.d/S999inittasks -> /sbin/init.d/inittasks )
containg the following code:
...
# Rename files by appending "_date_time" stamp at the end of name.
rename_files () {
for f in $* ; do
/usr/contrib/bin/perl -e '$_ = shift;
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = stat($_);
($sec,$min,$hour,$mday,$mon,$year) = localtime($mtime);
printf "%d%02d%02d_%02d%02d%02d\n",
$year+1900, $mon+1, $mday, $hour, $min, $sec;' $f | read ext
nf="${f%%_*}_$ext"
if [[ $f != $nf ]] ; then
print "$f -> $nf"
/bin/mv $f $nf || print "Error renaming $f"
fi
done
} # rename_files
...
rename_files /var/adm/syslog/OLD* /var/adm/OLD* /var/adm/cron/OLD*
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2008 05:30 AM
06-03-2008 05:30 AM
Solutionit even avoids the loss of information occuring in multiple reboots oldsyslog getting the last syslog