HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: logging script and sticky bit file
Operating System - HP-UX
1837097
Members
2341
Online
110112
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
01-27-2004 02:17 PM
01-27-2004 02:17 PM
I have a script that runs by cron, the script starts by starting the log file...
exec 1>$BACKUP_LOG 2>&1
I then get this sent to me in the mail.
This script also runs 3 other scripts, I need to check if it has another user sticky bit applied, how do I do that?
If the sticky bit is not applied I need it to notify me by mail.
So I know it will envolve an if statement.
What I am doing now, is at the end of the script, I grep $BACKUP_LOG for certain words, and if it finds, it emails me.
I am just wondering if I am going about it right...
exec 1>$BACKUP_LOG 2>&1
I then get this sent to me in the mail.
This script also runs 3 other scripts, I need to check if it has another user sticky bit applied, how do I do that?
If the sticky bit is not applied I need it to notify me by mail.
So I know it will envolve an if statement.
What I am doing now, is at the end of the script, I grep $BACKUP_LOG for certain words, and if it finds, it emails me.
I am just wondering if I am going about it right...
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 03:50 PM
01-27-2004 03:50 PM
Solution
Hi,
Put a small piece of code in your script something like this.
your_script_lines..
...
SCRIPT=/mylocation/myscr.sh
ll -d $SCRIPT |awk '$1 ~ "s|t|S|T" {print $0}' |grep -q $SCRIPT
if [ $? = 0 ]
then
echo "$SCRIPT has sticky bit on it" >> $BACKUP_LOG
fi
..
..
While you grep for certain words, add sticky bit also to it and get it mailed.
-Sri
Put a small piece of code in your script something like this.
your_script_lines..
...
SCRIPT=/mylocation/myscr.sh
ll -d $SCRIPT |awk '$1 ~ "s|t|S|T" {print $0}' |grep -q $SCRIPT
if [ $? = 0 ]
then
echo "$SCRIPT has sticky bit on it" >> $BACKUP_LOG
fi
..
..
While you grep for certain words, add sticky bit also to it and get it mailed.
-Sri
You may be disappointed if you fail, but you are doomed if you don't try
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP