- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Empty /var/adm/messages
Operating System - HP-UX
1753808
Members
7568
Online
108805
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
Discussions
Discussions
Forums
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
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
тАО05-21-2009 09:40 AM
тАО05-21-2009 09:40 AM
Re: Empty /var/adm/messages
Well, looks like smatador and Dennis are both right.
The error comes from the "grep -v date...".
I've taken it out for now but would still like to understand why the command is failing.
The cron command seems to be truncated at the first "%" character encountered as shown in the following cron log:
# tail -1000 log | grep dmesg
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v -e "ATI Radeon" -e "^$(date '+
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v -e "ATI Radeon" -e "^$(date '+
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v -e "ATI Radeon" -e "^$(date '+
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v "ATI Radeon" >> /var/adm/messages
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v "ATI Radeon" >> /var/adm/messages
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v "ATI Radeon" >> /var/adm/messages
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v "ATI Radeon" >> /var/adm/messages
The funny think is: the command works perfectly well from the command line or a shell script using the "usr/bin/sh" shell.
cron however seems to parse it differently.
Another thing, I received an error via roots mail when the grep command was written as grep -v "`date '+%b %e'`" but root stopped receiving errors once coded as grep -v "$(date '+%b %e')".
Can anyone shed some light on the differences in interpretation using these two forms?
The error comes from the "grep -v date...".
I've taken it out for now but would still like to understand why the command is failing.
The cron command seems to be truncated at the first "%" character encountered as shown in the following cron log:
# tail -1000 log | grep dmesg
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v -e "ATI Radeon" -e "^$(date '+
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v -e "ATI Radeon" -e "^$(date '+
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v -e "ATI Radeon" -e "^$(date '+
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v "ATI Radeon" >> /var/adm/messages
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v "ATI Radeon" >> /var/adm/messages
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v "ATI Radeon" >> /var/adm/messages
> CMD: /usr/sbin/dmesg - | /usr/bin/grep -v "ATI Radeon" >> /var/adm/messages
The funny think is: the command works perfectly well from the command line or a shell script using the "usr/bin/sh" shell.
cron however seems to parse it differently.
Another thing, I received an error via roots mail when the grep command was written as grep -v "`date '+%b %e'`" but root stopped receiving errors once coded as grep -v "$(date '+%b %e')".
Can anyone shed some light on the differences in interpretation using these two forms?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2009 04:51 AM
тАО05-22-2009 04:51 AM
Re: Empty /var/adm/messages
Finaly found the solution:
had to escape the "%" characters in the "date" command.
That might be a nice item to add to cron's man page.
Thanks all.
RayB
had to escape the "%" characters in the "date" command.
That might be a nice item to add to cron's man page.
Thanks all.
RayB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-22-2009 06:46 PM
тАО05-22-2009 06:46 PM
Re: Empty /var/adm/messages
>had to escape the "%" characters in the "date" command. That might be a nice item to add to cron's man page.
Oops, didn't notice that, even though I have a \% in mine.
It's right there in crontab(1):
A percent character (%) in this field (unless escaped by a backslash (\)) is translated to a newline character ...
Oops, didn't notice that, even though I have a \% in mine.
It's right there in crontab(1):
A percent character (%) in this field (unless escaped by a backslash (\)) is translated to a newline character ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-25-2009 05:43 AM
тАО05-25-2009 05:43 AM
Re: Empty /var/adm/messages
Thanks Dennis,
I had been looking at the "cron" manpage instead of "crontab".
RayB
I had been looking at the "cron" manpage instead of "crontab".
RayB
- « Previous
-
- 1
- 2
- Next »
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP