HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script for identifying when crontab has been modif...
Operating System - HP-UX
1831044
Members
3361
Online
110019
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
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
10-29-2003 10:01 AM
10-29-2003 10:01 AM
Script for identifying when crontab has been modified
I've been trying to construct a script based off of some of the postings I've found in this forum. I'm doing a diff between the existing crontab and a "base" copy of the crontab. If it finds a difference, it sends me a message. Yes, I'm shell script challenged. Here's what I have to this point:
ll crontabs | awk '{print $9}' | while read name
do
diff crontabs/$name /cron/backup/$name> $name_crontabtext
if [ -s crontabtext ]
then
mail....
-----------------------
I run into this: Syntax error at line 4 : `&' is not expected.
Where am I going wrong?
ll crontabs | awk '{print $9}' | while read name
do
diff crontabs/$name /cron/backup/$name> $name_crontabtext
if [ -s crontabtext ]
then
mail....
-----------------------
I run into this: Syntax error at line 4 : `&' is not expected.
Where am I going wrong?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2003 10:23 AM
10-29-2003 10:23 AM
Re: Script for identifying when crontab has been modified
if looks as though your cut and paste got mangled all that [ and ] stuff should be square brackets.
if [[ -s "${name_crontabtext}" ]]
then
mail ...
fi
if [[ -s "${name_crontabtext}" ]]
then
mail ...
fi
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2003 10:49 AM
10-29-2003 10:49 AM
Re: Script for identifying when crontab has been modified
I actually found that [ stuff in this forum in multiple places. Is it just getting scrambled somehow? The intent is to check if the file $name_crontab is a zero byte file. If not send the email that the crontab has been modified. Is that what I'm accomplishing with the square brackets?
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