- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Output of job run from cron
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
04-25-2001 08:05 AM
04-25-2001 08:05 AM
Output of job run from cron
I have made a shell that's suppposed to run everyday at 24.00hrs and search all files with s-bits set. If I run the shell from prompt it excutes correctly and the listing of found files are directed to a file. When I am calling the same shell through cron the shell executes at 24.00 hrs but there is no output in the directed file.
Do i have mention the output file in the cron itself ?
what if i have different output files that are used as input files ?
the enrty in my crontab is
0 0 * * * /mnb/admin/find_sbit.sh
the log shows
CMD: /mnb/admin/find_sbit.sh
root 10858 c Mon Apr 23 00:00:00 IST 2001
how should I go about it ?
bye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2001 09:52 AM
04-25-2001 09:52 AM
Re: Output of job run from cron
should fix your problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2001 09:53 AM
04-25-2001 09:53 AM
Re: Output of job run from cron
When shell scripts are run from cron, they default using the /bin/sh shell. This may be an issue depending on how your script was created. When you run the script from the shell do you run it like this:
/mnb/admin/find_sbit.sh
or
/mnb/admin/find_sbit.sh > sbit.out
If you run it from command line and redirect the output to a file, then you will have to do the same in cron, such as:
0 0 * * * /mnb/admin/find_sbit.sh > sbit.out
If this is not the case, ensure that whatever shell you use for your testing is in the header of the script, ex.:
#!/bin/ksh
So cron does not automatically run it with /bin/sh. Let me know if this helps or not, an example of your script would help in determining what is going on. Good luck.
- Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2001 01:07 PM
04-25-2001 01:07 PM
Re: Output of job run from cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2001 05:59 PM
04-25-2001 05:59 PM
Re: Output of job run from cron
You'll have to specify the output file in your cron entry
eg. 0 0 * * * your_cron > your_cron.out 2>&1
note for the "2>&1", that would re-direct all standard errors to standard out as well, this way you can see every output message that came out from your job.
If you DON'T specify an output file in your cron job, you should still be able to see the outputs in your emails because the cron daemon would do you this flavour.
I'm not sure if I catch your second question correctly but I'll give it a try. "Input" parameters are usually constant, unless you entered a command expression on this. You can re-write your cron entry as,
0 0 * * * your_cron > `
Be careful if
Hope this help.
Regards,
Philip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2001 02:53 AM
04-26-2001 02:53 AM
Re: Output of job run from cron
Also change the cron time to either 23:59 or 00:01 hours as the time of 00:00 could be causing a problem (zero hours and zero mins).
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2001 03:02 AM
04-26-2001 03:02 AM
Re: Output of job run from cron
0 0 * * * /mnb/admin/find_sbit.sh > /tmp/OUTPUT 2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2001 09:12 AM
04-26-2001 09:12 AM
Re: Output of job run from cron
0 0 * * * /mnb/admin/find_sbit.sh > mylog 2>&1
this will send the standard output & std err to mylog
- fnhalili