Operating System - HP-UX
1756598
Members
2732
Online
108848
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
тАО01-11-2001 09:18 AM
тАО01-11-2001 09:18 AM
Cron Job
Running a Cron job with the following commands:
<>
cat fifo3 |gzip > /oracle_exports/XPS_PRD/XPS_PRD_EXPORT.dmp.gz &
exp / file = fifo3 parfile=db_export.ctl buffer=10000000 direct=y &
Running the above script by changing the directory to where the above script is avaialable with the following command:
cd /xps_prd/express/work/xps_prd/murali
db_export.sh
Script errors out with the following message:
db_export.sh[2]: exp: not found.
db_export.sh: gzip: not found.
But i am able to run a export from the same directory '/xps_prd/express/work/xps_prd/murali' manually.
Appreciate you help to resolve this.
Milan
<
cat fifo3 |gzip > /oracle_exports/XPS_PRD/XPS_PRD_EXPORT.dmp.gz &
exp / file = fifo3 parfile=db_export.ctl buffer=10000000 direct=y &
Running the above script by changing the directory to where the above script is avaialable with the following command:
cd /xps_prd/express/work/xps_prd/murali
db_export.sh
Script errors out with the following message:
db_export.sh[2]: exp: not found.
db_export.sh: gzip: not found.
But i am able to run a export from the same directory '/xps_prd/express/work/xps_prd/murali' manually.
Appreciate you help to resolve this.
Milan
Knowledge grows with Sharing
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2001 11:03 AM
тАО01-11-2001 11:03 AM
Re: Cron Job
Hi Milan:
The cron environment is not the same as the one you have established when you execute at command line.
One common problem is a PATH variable that doesn't contain values that allow resolution of relative paths in your script. You can resolve this by using fully qualified filenames in your script or by setting the PATH (or other environmental variables) ahead of your script in the crontab entry.
In general, environmental variables can be embedded in your script as necessary, or they can be specified and exported or file-sourced in the crontab entry like:
0 1 * * * (V=x;export V;/usr/local/bin/my.sh)
0 1 * * * (. /home/my/.env /home/my/script)
...JRF...
The cron environment is not the same as the one you have established when you execute at command line.
One common problem is a PATH variable that doesn't contain values that allow resolution of relative paths in your script. You can resolve this by using fully qualified filenames in your script or by setting the PATH (or other environmental variables) ahead of your script in the crontab entry.
In general, environmental variables can be embedded in your script as necessary, or they can be specified and exported or file-sourced in the crontab entry like:
0 1 * * * (V=x;export V;/usr/local/bin/my.sh)
0 1 * * * (. /home/my/.env /home/my/script)
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2001 11:13 AM
тАО01-11-2001 11:13 AM
Re: Cron Job
Milan,
In your crontab entry, I would put the following:
/xps_prd/express/work/xps_prd/murali/db_export.sh
instead of just db_export.sh.
And in your db_export.sh, add the path that gzip is in to the top of the script, ie
export PATH=$PATH:/pathofgzip
Alternatively, you can call gzip with the complete path in your db_export.sh script.
Hope that this helps,
Mo
In your crontab entry, I would put the following:
/xps_prd/express/work/xps_prd/murali/db_export.sh
instead of just db_export.sh.
And in your db_export.sh, add the path that gzip is in to the top of the script, ie
export PATH=$PATH:/pathofgzip
Alternatively, you can call gzip with the complete path in your db_export.sh script.
Hope that this helps,
Mo
No matter where you go, there you are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2001 02:32 AM
тАО01-15-2001 02:32 AM
Re: Cron Job
The environment in which cron executes jobs is not the same as your login environment. I quote from 'man crontab':
> cron supplies a default environment for every shell, defining:
>
> HOME=user's-home-directory
> LOGNAME=user's-login-id
> PATH=/usr/bin:/usr/sbin:.
> SHELL=/usr/bin/sh
>
> Users who desire to have their .profile executed must explicitly do so in the crontab entry or in a script called by the entry.
Running .profile usually causes problem when it tries to query the terminal settings. It is often better to set your environment (in your case PATH) inside your script or specify the full path in front of each command that fails (in your script 'gzip' and 'exp')
> cron supplies a default environment for every shell, defining:
>
> HOME=user's-home-directory
> LOGNAME=user's-login-id
> PATH=/usr/bin:/usr/sbin:.
> SHELL=/usr/bin/sh
>
> Users who desire to have their .profile executed must explicitly do so in the crontab entry or in a script called by the entry.
Running .profile usually causes problem when it tries to query the terminal settings. It is often better to set your environment (in your case PATH) inside your script or specify the full path in front of each command that fails (in your script 'gzip' and 'exp')
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