- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Trying to extract last months entries from sulog
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
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
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-10-2018 06:59 AM
12-10-2018 06:59 AM
Trying to extract last months entries from sulog
Hi
The auditors want us to extract 'last months' SU's to oracle. ie on 1 Dec 2018, I want to generate an email that reports Nov 1 - 31 2018 activities, for example.
Following on, on 1 Jan 2019, I need to report on Dec 1 - 31 2018.
I have a crude 3 liner that works in the current year (just about):
last_month=$(date +%m | awk -F '/' '{$NF--}1' OFS='/')
this_year=$(date +%Y)
grep "SU $last_month" /var/adm/sulog | grep orar12 | /usr/bin/mailx -s "SUs to orar12 for $last_month/$this_year" recipient@email.address
Hope you can help.
Regards
Tariq
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 09:53 PM
12-12-2018 09:53 PM
Re: Trying to extract last months entries from sulog
I believe you could schedule cron jobs to run at every monthend at 12 midnight to copy the sulog with date, month and year and nullify the existing sulog.In this way, you will have sulog of every month available and can be attached and sent in email.