![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| running X-11 programs as root | Allasso | UNIX for Advanced & Expert Users | 8 | 12-28-2007 03:22 PM |
| Command Not running in script | Dastard | Shell Programming and Scripting | 2 | 05-21-2007 05:08 PM |
| running multiple rsh command in a script | lweegp | Shell Programming and Scripting | 0 | 10-31-2006 02:37 AM |
| PS command does not display shell script running | hadarot | Shell Programming and Scripting | 4 | 09-15-2005 05:56 AM |
| running a scr in rc3.d not as root, can i? | kymberm | UNIX for Advanced & Expert Users | 6 | 11-12-2002 11:50 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I'm writing an application (Progress language) that needs to:
1) load the contents of a cron table into the Progress application; 2) display this information in a human manner and allow a select group of people to update it (these people are logged in as themselves, not as root); 3) save everything back to the cron table (probably just overwrite the existing file with the newly generated one). My questions relate to (1) and (3). The cron file is located in a directory called /var/spool/cron/crontabs/ -r-------- 1 root sys 1978 May 24 10:58 qadbatch As you can see, only root can Read and Write to this file (and we like it this way!!). Any ideas on how to read and overwrite this file without being root? Notes: A- The Progress application can run any Unix commands or scripts and retrieve their output (but it cannot run interactive commands such as 'crontab -e'). B- Users do not have access to the crontab command. Thanks!! Réal |
|
||||
|
OK, I found a few ways to do that but I was approaching the problem from the wrong angle.
You cannot modify the cron file owned by root, or so it says in man. You have to use the crontab command. This being established, how do I allow a user to modify another user's cron table? I first thought of sudo but it's not installed here and I would have to convince the sys-admins to do this - more problems... Remote Shell! That is the way to go! You setup the user who owns the cron table to accept remote access from select users (create a .rhosts file in this user's home dir). Then, those select users can rsh (remsh on certain systems) their way into the owner's crontab entry: $ rsh <server-name> -l <cron-userid> "crontab <new-cron-file>" Voila! Thanks to those who replied. Réal |
![]() |
| Bookmarks |
| Tags |
| unix commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|