Skip to ContentSkip to Footer
Start of content
- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- cron job
General
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
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
- Email to a Friend
- Report Inappropriate Content
07-22-2008 01:13 PM
07-22-2008 01:13 PM
cron job
Hi,
i have a shell scirpt which captures the output of a command using "script" command. i would like to run this shell script using cron job and this is not working as shell script is running a command using script command which i believe run the command in different shell.
is there a work around this problem? how could i run the shell script using cron?
Thanks,
Chakri
i have a shell scirpt which captures the output of a command using "script" command. i would like to run this shell script using cron job and this is not working as shell script is running a command using script command which i believe run the command in different shell.
is there a work around this problem? how could i run the shell script using cron?
Thanks,
Chakri
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-22-2008 02:31 PM
07-22-2008 02:31 PM
Re: cron job
hey
source your profile at the begin of your script, so that you have not the standard cron shell. e.g. you set the PATH env var in your profile etc..
to source your profile:
. /home/user/.profile
it would be helpful if you could poste more detail about the error of the script and also the script
regards
source your profile at the begin of your script, so that you have not the standard cron shell. e.g. you set the PATH env var in your profile etc..
to source your profile:
. /home/user/.profile
it would be helpful if you could poste more detail about the error of the script and also the script
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-25-2008 04:36 PM
08-25-2008 04:36 PM
Re: cron job
did you schedule the script to run with the -c flag and add an "exit" at the end of the script?
e.g. crontab
* * * * * script -c "test.sh" output.log
last line of test.sh should be "exit".
e.g. crontab
* * * * * script -c "test.sh" output.log
last line of test.sh should be "exit".
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.
End of content
United States
Hewlett Packard Enterprise International
Communities
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP