- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need Helpl in setting the cronfile
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
01-14-2007 09:44 PM
01-14-2007 09:44 PM
I want set some cron files for different users. I have all the new cron files as username.new for all the users. So I want to set the new cron file using root. But
crontab [file_name] will set the cron file for current user, can you please help me setting the new cron file, login as a root"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2007 09:47 PM
01-14-2007 09:47 PM
Re: Need Helpl in setting the cronfile
su - username
crontab file_name
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2007 09:48 PM
01-14-2007 09:48 PM
Re: Need Helpl in setting the cronfile
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2007 10:02 PM
01-14-2007 10:02 PM
Re: Need Helpl in setting the cronfile
rename the username.new to username into /var/spool/cron/crontabs directory.
chmod 400 /var/spool/cron/crontabs/username
Add user to crontab.allow
All as root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2007 10:36 PM
01-14-2007 10:36 PM
Re: Need Helpl in setting the cronfile
I have a trick for this - but never tried this under HP-UX. Facts:
- The crontab command uses the value of the env-variable EDITOR to set a user specific editor.
- The crontab call 'crontab -e usrnam' edits the cron-entry of 'usrnam' (if called by root user).
Now use:
for cronfile in *.new
do
usrnam=${cronfile%*.new}
cat $cronfile | EDITOR=/usr/bin/tee crontab -e $usrnam
done
This will both print the content of the file to stdout and the temporary crontab-file without the need of further input.
Better perform a test with one file first ...
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2007 10:55 PM
01-14-2007 10:55 PM
Re: Need Helpl in setting the cronfile
suitable
U can do that like this as root
first add username in /var/adm/cron/cron.allow
then run following
for Users in user1 user2 . . .
do
cp ${Users}.new /var/spool/cron/crontabs/${Users}
chown root:users /var/spool/cron/crontabs/${Users}
chmod 400 /var/spool/cron/crontabs/${Users}
done
thats all
-Santosh Mhaskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2007 11:13 PM
01-14-2007 11:13 PM
Re: Need Helpl in setting the cronfile
I Have some cronfiles like root, sys, adm etc, I want to replace this cronfile with my new cron file with .new as the extension. Please give me a solution for this. (I have two versions of cronfiles for different users I want to replace old version of cron with my new version of cronfile with .new as the extension)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2007 11:40 PM
01-14-2007 11:40 PM
Solutionmy solution will do exactly that.
For a single file use:
cat username.new | EDITOR=/usr/bin/tee crontab -e username
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2007 11:51 PM
01-14-2007 11:51 PM