- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Running cron with wrong shell
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
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
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
06-18-2018 06:29 AM - edited 06-18-2018 06:35 AM
06-18-2018 06:29 AM - edited 06-18-2018 06:35 AM
Running cron with wrong shell
Hello,
I have cron job which runs script, the problem is that by default shell is /usr/bin/sh and not the /sbin/sh or usr/local/bin/bash . I've already tried adding different shebang and cronjob as 5, 10 * * * */usr/local/bin/bash /opt/scripts/script.sh. At the moment I cannot change /etc/passwd to use other shell for an user. Is there any other way to force run cron with other shell?
I also receive warning: commands will be executed using /usr/bin/sh message as I edit crontab..
Script perfectly runs on all shells exepct for /usr/bin/sh which misses some of libraries, I guess.
- Tags:
- crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2018 10:31 AM
06-18-2018 10:31 AM
Re: Running cron with wrong shell
As long as your script has #! on first line, you don't need to mention the shell in crontab.
> /usr/bin/sh which misses some of libraries,
What libraries are missing? Do you get an error when you invoke /usr/bin/sh?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2018 10:50 AM
06-18-2018 10:50 AM
Re: Running cron with wrong shell
I thought so too, but if I try to run script with bash, - it works like charm and it does not work while on cron job or neither with /usr/bin/sh script.sh.
#! has no effect at all.
About the libraries, I read somewhere on internet that /usr/bin/sh misses some of the libraries, not sure about that. Tomorrow I'll try to run it and check it for errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2018 10:31 AM
06-25-2018 10:31 AM
Re: Running cron with wrong shell
> I read somewhere on internet that /usr/bin/sh misses some of the libraries,
Not misses but uses extra shlibs. If they are missing, your installation is broken.