Hello to everyone,
I'm new here and would like to thank everybody for the upcoming support, I know that I will have my question answered here, this community is huge.
First of all, I´m a DBA and work on a daily basis on Unix environments of all kinds (HP-UX, Solaris, AIX, etc). I have low knowledge on UNIX since I started messing with it for a short while.
Although I'm a DBA, I'm very curious to learn UNIX and Linux, because I used Windows for my entire life, now that I was introduced to UNIX I'm finding it awesome.
I have a question that you might help me with it:
For example, I have my username and password on all UNIX environments that we work, and to do DBA tasks, we must "sudo su - oracle" (to gain access to oracle user permissions), to do things related to oracle binaries.
What I'm trying to accomplish is, when we got our oracle crontab altered, when I do the first "exit" command (to exit sudo of oracle), I want to check that something is changed on the cron (like a commented line) and give me a warning message.
For example:
I'm logged into Oracle user by sudo'ing it. I edit the crontab (crontab -e), I put a # to comment a line on the cron then save it (we usually to this to avoid jobs running and erroring due to maintenance window). When I log out of Oracle by issuing "Exit", is there any way to display something like this:
"There is a commented job on your crontab, please check".
Well, of course my script will not have a history of the cron and will not do analysis of what actually is the current job commented. But only check for a special character (like #) or if something changed since the last login to oracle user.
Is that possible? I have little to almost none knowledge of shell scripting, so a patient explanation might be necessary.
Thank you very much for your support.