- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- functions in cron jobs
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
09-10-2002 09:01 PM
09-10-2002 09:01 PM
Can a function be used in a script and executed via cron, and be expected to work properly?
op sys: ux11.00
system: D390
Thanks
maria.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 09:23 PM
09-10-2002 09:23 PM
SolutionBasically any script or program can run from cron if the crontab entry and corresponding script has the appropriate permissions. Just about any program that you can run from the command line will run in cron.
Attached is an example script that has functions.
HTH
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 10:47 PM
09-10-2002 10:47 PM
Re: functions in cron jobs
you can run every command and script with cron. But take care, that you make sure variables are known in your scripts and functions. So either export them before starting your scripts or define them into scripts or functions.
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2002 11:37 AM
09-11-2002 11:37 AM
Re: functions in cron jobs
#!/usr/bin/shell_name
But you probably knew that ;-)
- Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2002 11:41 AM
09-11-2002 11:41 AM
Re: functions in cron jobs
Maria,
When dealing with cron's you must remember that the ENVIRONMENT variables are very limited.
Now as for a cron job, say a SHELL SCRIPT with functions, yes that shell script will operate correctly, BUT REMEMBER the rule above!
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2002 02:32 PM
09-11-2002 02:32 PM
Re: functions in cron jobs
Maria.