- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: one script to be executed in 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
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
07-07-2011 06:15 AM
07-07-2011 06:15 AM
hi guys ,
i want to execute a common script which should be executed by 2 diff users in cron ...
user1 to execute script at day time 06-22
user2 to excute same script at 22-06
the problm we call .profile in that script....so hw should i call the same..for 2 users.....???
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2011 06:29 AM
07-07-2011 06:29 AM
Re: one script to be executed in cron
Are you running the script for each user's crontab? I am assuming the issue is that each users profile is different. Why not just make this a variable and provide each user's profile as part of the command to execute the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2011 07:11 AM
07-07-2011 07:11 AM
Re: one script to be executed in cron
Hi:
I do not practice putting environmental variables in my login profiles. Rather, I source (read, using the 'dot-space-filename' notation) any variable settings I need from an independent file.
You don't offer whether these two users will be executed by the 'root' crontab or as crontab's belonging to each user. If 'root' is the one executing, you could simply do :
su - theuser -c script_to_run
The 'su -' causes the login profile of the user to be executed before the 'script_to_run'.
If each user is going to execute the common script, the encapsulation of the necessary environmental variables into a standalone file which *both* the login profile and the script can source (read) is preferred in my opinion.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2011 08:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2011 02:25 AM
07-08-2011 02:25 AM
Re: one script to be executed in cron
hi Dennis ,
u were spot on ..thankss...very much...