- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: shell script
Operating System - HP-UX
1752675
Members
5642
Online
108789
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
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
тАО12-12-2010 07:40 PM
тАО12-12-2010 07:40 PM
shell script
dear expert
usually i'm manual to run this CHECK.FILES command to check the file is got any problem or not .
Right now ,i wan to use crond job to control it. so i think i need to write a shell script to control it . by the way the path of file is /tmp/check.rx/chk.chs.files
may i know write the shell script ?
usually i'm manual to run this CHECK.FILES command to check the file is got any problem or not .
Right now ,i wan to use crond job to control it. so i think i need to write a shell script to control it . by the way the path of file is /tmp/check.rx/chk.chs.files
may i know write the shell script ?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-12-2010 09:55 PM
тАО12-12-2010 09:55 PM
Re: shell script
Hello shell
it is funny shell script is asking about shell script. :)
anyway .
As far as i understand that /tmp/check.rx/chk.chs.files is your executable which you use to check the files.
no need for a script to run this command. all what you need is to put this path "/tmp/check.rx/chk.chs.files" in your cron table and let it run it for you.
it is funny shell script is asking about shell script. :)
anyway .
As far as i understand that /tmp/check.rx/chk.chs.files is your executable which you use to check the files.
no need for a script to run this command. all what you need is to put this path "/tmp/check.rx/chk.chs.files" in your cron table and let it run it for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2010 06:09 AM
тАО12-13-2010 06:09 AM
Re: shell script
Hi:
> usually i'm manual to run this CHECK.FILES command to check the file is got any problem or not . Right now ,i wan to use crond job to control it. so i think i need to write a shell script to control it . by the way the path of file is /tmp/check.rx/chk.chs.files
When running a script from 'cron' the most common failure (if any) is that 'cron' offers only a rudimentary environment. Essentially, you have your 'HOME', 'LOGNAME', 'SHELL' and most importantly a simple, default 'PATH'. Any variables you have defined and exported in your login shell are absent.
Your choices are several. Source (read) your '.profile' and then run your script:
# . ./profile;/tmp/check.rx/chk.chs.files
Note the dot ('.') followed by whitespace, followed by the '.profile'.
Another choice is to encode *all* of the variables you need in your script. A third choice is to declar the variables your script needs in a separate file which can be sourced (read) by any script (or profile) requiring them.
There are any number of posts in the forum with more details on the benefits and pitfalls of the above methods.
By the way, putting a production, permanent script in the '/tmp' directory is bad practice. It's liable to get removed during a reboot or vanquished by a system administrator who "knows better".
Regards!
...JRF...
> usually i'm manual to run this CHECK.FILES command to check the file is got any problem or not . Right now ,i wan to use crond job to control it. so i think i need to write a shell script to control it . by the way the path of file is /tmp/check.rx/chk.chs.files
When running a script from 'cron' the most common failure (if any) is that 'cron' offers only a rudimentary environment. Essentially, you have your 'HOME', 'LOGNAME', 'SHELL' and most importantly a simple, default 'PATH'. Any variables you have defined and exported in your login shell are absent.
Your choices are several. Source (read) your '.profile' and then run your script:
# . ./profile;/tmp/check.rx/chk.chs.files
Note the dot ('.') followed by whitespace, followed by the '.profile'.
Another choice is to encode *all* of the variables you need in your script. A third choice is to declar the variables your script needs in a separate file which can be sourced (read) by any script (or profile) requiring them.
There are any number of posts in the forum with more details on the benefits and pitfalls of the above methods.
By the way, putting a production, permanent script in the '/tmp' directory is bad practice. It's liable to get removed during a reboot or vanquished by a system administrator who "knows better".
Regards!
...JRF...
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