- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- crontab permissions
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
04-18-2008 12:49 AM
04-18-2008 12:49 AM
will anybody please tell me how to assign the permission to modify the crontab to some another user..?
and also let me know how to recover the crontab file is it is deleted accidently.
thanx in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 12:52 AM
04-18-2008 12:52 AM
Re: crontab permissions
#crontab
(without any options).i have not made any experiment as i came to know it will remove all the cron jobs..please let me know how much it is true...
thanx in advance..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 12:59 AM
04-18-2008 12:59 AM
Re: crontab permissions
You recover your crontab from backup.
Path would be:
/var/spool/cron/crontabs/
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 01:09 AM
04-18-2008 01:09 AM
Solution>(without any options).i have not made any experiment as i came to know it will remove all the cron jobs..please let me know how much it is true...
Yes. you will lose all the crontab entries if you do this (followed by: control+D).
In fact, when you launch "crontab", the program will wait for your inputs. Pressing Control+D will commit the changes made. But, control+C will discard all changes and the current crontab settings will remain the same.
hope this help!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 01:09 AM
04-18-2008 01:09 AM
Re: crontab permissions
You can't. Only you and root can modify it.
In fact on my 11.23 system, the original user can't read it (except by crontab -l):
$ ll /var/spool/cron/crontabs
-r-------- 1 root GRP-name USR-name
You could use chmod a+r on that file so anyone can read it. I suppose you could allow group write: chmod g+w
Why do you want to do this?
>please tell me what could happen if I execute only this command..
>#crontab
>(without any options). ... as I came to know it will remove all the cron jobs.
This will empty the crontab entry for the user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 01:10 AM
04-18-2008 01:10 AM
Re: crontab permissions
but tell me what will happen if i run #crontab without any option...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 01:12 AM
04-18-2008 01:12 AM
Re: crontab permissions
SRV2>crontab -e
#*******************************************************************************
# min|hour |day |month|day | |script
# | |of mo| |of wk| |
#----|-----|-----|-----|-----|-------|-----------------------------------
#*******************************************************************************
#
#
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
~
~
~
~
"/tmp/crontab3Zqcya" 11 lines, 541 characters
SRV2>crontab -l
#*******************************************************************************
# min|hour |day |month|day | |script
# | |of mo| |of wk| |
#----|-----|-----|-----|-----|-------|-----------------------------------
#*******************************************************************************
#
#
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
SRV2>crontab
^D <==========control+D pressed
SRV2>crontab -l
SRV2>crontab
#*******************************************************************************
# min|hour |day |month|day | |script
# | |of mo| |of wk| |
#----|-----|-----|-----|-----|-------|-----------------------------------
#*******************************************************************************
#
#
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
SRV2>crontab -l
#*******************************************************************************
# min|hour |day |month|day | |script
# | |of mo| |of wk| |
#----|-----|-----|-----|-----|-------|-----------------------------------
#*******************************************************************************
#
#
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
SRV2>crontab
^C <==========control+C pressed
SRV2>crontab -l
#*******************************************************************************
# min|hour |day |month|day | |script
# | |of mo| |of wk| |
#----|-----|-----|-----|-----|-------|-----------------------------------
#*******************************************************************************
#
#
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
SRV2>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 01:16 AM
04-18-2008 01:16 AM
Re: crontab permissions
Mentioned it above.
#crontab
Will cause the program to interact with you. It just hangs waiting for your inputs.
If you
Control+C => discard changes and original content unchanged.
Control+D => commit changes and original content is LOST!!.
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 01:29 AM
04-18-2008 01:29 AM
Re: crontab permissions
0 5 * * 0 crontab -l > /tmp/cron.safe # Backup crontab file in case of accidental deletion
This creates a backup copy in /tmp every Sunday at 5 o'clock in the morning. To make the backup current type:
crontab /tmp/cron.safe
If you have more than one user doing this, make sure they use different names for the safe copy: e.g. /tmp/cron.safe.username.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 02:09 AM
04-18-2008 02:09 AM
Re: crontab permissions
If you are fiddling with crontabs, always use crontab -e.
And as you suggested, use crontab -l to create a backup, every so often.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 06:27 AM
04-18-2008 06:27 AM
Re: crontab permissions
The reason for this is: the "crontab" command does more than just start the editor. It also signals the cron daemon after any changes are made. Upon receiving the signal, the cron daemon knows to re-read your crontab file.
If this signalling is not done, the cron daemon will not notice your changes: it will keep executing the old version of your crontab information.
I've seen this happen: it really confuses anyone who does not know how cron works.
The best way to allow User A to edit User B:s crontab is to use sudo (or some other similar tool) to allow A to execute "crontab -e" as user B.
The sudo configuration syntax for this would be:
userA hostname=(userB) crontab -e
and the userA would have to execute this command:
sudo -u userB crontab -e
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 10:01 PM
04-18-2008 10:01 PM
Re: crontab permissions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2008 10:01 PM
04-18-2008 10:01 PM