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
Discussions
Forums
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
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
тАО11-28-2001 06:45 PM
тАО11-28-2001 06:45 PM
cron
I have some questions:
1. Who is the best guy to stop/start cron process. root or anyone?
2. the owner of all cron job files must be root? and the right should be 400?
3. When I modified a cron job, what is the
best way to let it refresh? just do crontab file? sometimes it seems doesn't work.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 06:52 PM
тАО11-28-2001 06:52 PM
Re: cron
generally cron is "owned" by root. That is the cron process:
root 1406 1 0 Nov 7 ? 0:00 /usr/sbin/cron
This just makes sure that things get run.
To start and stop on an HPUX system the easiest way is:
/sbin/init.d/cron stop
/sbin/init.d/cron start
Leave it running all the time.
To refresh cron, you need only edit the crontab.
crontab -e
this will take you into a vi editor mode (by default unless your VISUAL variable is set to something else). I'm lazy, so hitting
Generally anyone can use cron.
You may however have two files called cron.allow and cron.deny OR at.allow and at.deny.
These (if imnplemented) can allow and deny specific users from using cron. It's generally a good idea unless you want your users to be putting in huge cron jobs all the time.
man cron should be a start as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 06:56 PM
тАО11-28-2001 06:56 PM
Re: cron
Cron normally runs as root, meaning that only root can stop/start the cron daemon.
Normally, you should not mess directly with cron's spool files. If you want to submit a job to cron, use:
crontab -e
This will open an editor window with the current contents of your crontab.
To see what's on your crontab:
crontab -l
Individual users can have individual crontabs. Cron will run each user's cron jobs as that user's uid.
Regards,
Paga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 07:01 PM
тАО11-28-2001 07:01 PM
Re: cron
vi the file and no need to stop/start cron?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 07:03 PM
тАО11-28-2001 07:03 PM
Re: cron
Don't just vi the file.
Switch to root - or whoever and use crontab -e
This is the correct way update cron.
What happens when you do this is that cron will automagically schedule a re-read of the file if it is changed.
This is how cron will know that new stuff is there.
If you edit the file directly, then cron may get confused.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 07:11 PM
тАО11-28-2001 07:11 PM
Re: cron
do crontab -e, it will only change the
root's cron file, if I want to moify
other users, such as abc, how can I
do that? when I login as abc, and do
a crontab -e, it will go into /var/tmp/????
not the right file, btw abc already have
a cron file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 07:14 PM
тАО11-28-2001 07:14 PM
Re: cron
So yes, you can just su to the user's id and do a crontab -e; it will work.
You can verify by doing a crontab -l after making the changes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 07:14 PM
тАО11-28-2001 07:14 PM
Re: cron
The best way to do that is login as your user "abc" and do the same way how you have done it for root. Remember you may need to have the proper file permissions for that user as well.
Thats it.
Cheers !!!
Mathew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 07:14 PM
тАО11-28-2001 07:14 PM
Re: cron
then do a crontab -e from there
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 07:22 PM
тАО11-28-2001 07:22 PM
Re: cron
To change a different users crontab
you need to do this.
# su - abc
$ crontab -l >/tmp/wrkfile
$ vi wrkfile
(make changes and save)
$ crontab /tmp/wrkfile
$ exit
#
It is not a good idea to directly edit
the crontab file. It is better to edit
a copy and re-submit it.
-Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-28-2001 08:24 PM
тАО11-28-2001 08:24 PM
Re: cron
As others have said, you should not directly edit files in /var/spool/cron/crontabs. You can use either "crontab -e" or "crontab -l >file;edit file;crontab file". Either way, you must "su -" to the account for which you want to modify the crontab.
I suggest you make a backup of the account's crontab file before you change it (but don't make that backup in /var/spool/cron/crontabs). I like to make a directory specifically for crontab backups so I do:
cd /var/spool/cron
mkdir crontabs.bak
cp -p crontabs/* crontabs.bak
That way I have a backup of all the crontabs. Of course, non-superuser accounts would have to make their copy somewhere else but I'm assuming you are talking about the ones you (the superuser) change.
Darrell