- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cannot edit crontab within script sessions
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
08-04-2006 03:14 AM
08-04-2006 03:14 AM
cannot edit crontab within script sessions
script somefile
crontab -e
crontab still invokes the editor (vi) as normal, but when you try to exit, it gives an error message
crontab: can't create your crontab file in the cdrontab directory.
Funny thing, I have no problems on our 11.23 system, but I see this problem on our 11.11 systems. And yes, I know capturing the output of a vi editor in a script is of dubious value, but that's another matter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2006 03:36 AM
08-04-2006 03:36 AM
Re: cannot edit crontab within script sessions
when you run crontab -e it uses a temporary file to edit in vi. On exit it writes the data back to the original file.
Have you compared privs on /usr/bin/crontab ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2006 03:54 AM
08-04-2006 03:54 AM
Re: cannot edit crontab within script sessions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2006 04:02 AM
08-04-2006 04:02 AM
Re: cannot edit crontab within script sessions
I definitly would not call "crontab -e" in a script.
Let another file be processed by your script, initialized via
crontab -l >tmpfile
After all modifications are done, perform something like
if crontab tmpfile
then rm tmpfile
else
# do error processing, tmpfile kept
fi
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2006 04:05 AM
08-04-2006 04:05 AM
Re: cannot edit crontab within script sessions
If you start script can you do a 'crontab -l > my.cron', then 'crontab my.cron', or do you get the error then, too?
If not, you could script a
crontab -l > my.cron && vi my.cron && crontab my.cron
command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2006 05:51 AM
08-04-2006 05:51 AM
Re: cannot edit crontab within script sessions
If I do
crontab -l > tmpfile
... edit tmpfile
crontab tmpfile
it works and I don't get the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2006 05:54 AM
08-04-2006 05:54 AM
Re: cannot edit crontab within script sessions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2006 06:44 AM
08-04-2006 06:44 AM
Re: cannot edit crontab within script sessions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2006 06:45 AM
08-04-2006 06:45 AM