- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to run a cron job with root user
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
05-01-2005 02:10 PM
05-01-2005 02:10 PM
On my hp server, i would like to schedule a cron job to be run by root, I'm just wondering whether below is the correct file to modify, so root user can run the job.
/var/spool/cron/crontabs/root.live ?
is root.live file is the one i need to modify, so the root user can run the cron job?
Cheers,
Raf
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2005 02:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2005 02:46 PM
05-01-2005 02:46 PM
Re: How to run a cron job with root user
crontab -e edits root cron, though others work on a file and move it to the appropriate location in /var/spool/cron
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2005 03:14 PM
05-01-2005 03:14 PM
Re: How to run a cron job with root user
#crontab -e
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2005 03:34 PM
05-01-2005 03:34 PM
Re: How to run a cron job with root user
Make sure you login as root :) and then do a crontab -e to edit the root's crontab file.
Regards,
Naveej
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2005 04:37 PM
05-01-2005 04:37 PM
Re: How to run a cron job with root user
I've already trying running crontab -e as root before sending my last message, but it bombed out with an error message that crontab can't be opened?????
cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2005 05:09 PM
05-01-2005 05:09 PM
Re: How to run a cron job with root user
Login as root, and look for a file named root in /var/spool/cron/crontabs directory. If the file doesn't exist, create it and make the entries to this file.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2005 05:55 PM
05-01-2005 05:55 PM
Re: How to run a cron job with root user
You can try this.
1. su to root
2. check EDITOR env. (EDITOR=vi)
3. vi /var/adm/cron/cron.allow
Ex. root #<--Add
4. ps -ef|grep cron
Ex. /usr/sbin/cron
5. crontab -e
Ex. * * * * * /var/tmp/test.sh
Hope help you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2005 03:55 PM
05-02-2005 03:55 PM
Re: How to run a cron job with root user
please make sure if you have a cron.allow file, the contents have root.
If you don't either have one created with the entries root adm and uucp
If this file is missing for some reason, and you want cron access to the entire system, just touch /var/adm/cron/cron.deny
Also check for the cron daemon
ps -ef| grep cron
if there is none just issue the command
/usr/sbin/cron
I hope after this there is no reason for cron not to work.
thanks
Devesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2005 04:13 PM
05-02-2005 04:13 PM
Re: How to run a cron job with root user
I have manually created this file with the touch command and modified it accordingly, i can now run crontab -e or with -l options.
Thanks for everyone's help
Cheers,
Raf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2005 03:05 AM
05-03-2005 03:05 AM
Re: How to run a cron job with root user
I usually do not recommend using crontab -e.
I do:
crontab -l > /var/spool/cron/root.copy
edit the root.copy file.
Then do:
crontab /var/spool/cron/root.copy.
This method gives you a copy and if you finger check a entry, you don't have to recover your crontab entry from backup.
Rory