LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-13-2006, 01:27 AM   #1
BiThian
Member
 
Registered: Aug 2006
Location: Romania
Distribution: NetBSD 3.1
Posts: 118

Rep: Reputation: 15
crontab -e username doesn't work


Every time I try that command, in /var/spool/cron appears an empty file like crontab.3435~ , but my /var/spool/cron/crontabs/username file is still 0 bytes length. What am I doing wrong?

Last edited by BiThian; 10-13-2006 at 01:45 AM.
 
Old 10-13-2006, 01:30 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Did you save the file? When you start
Code:
crontab -e [username]
you start a text-editor, and after you've edited the cron file and saved, only then the actual cron file gets altered. As long as you don't save, the original file is not altered (or even opened, if I'm right). And if the original cronfile is empty when you begin, it's length is zero indeed, until you save some information to it.

Try to edit the file, add an entry, save, exit and re-open it again with crontab -e and see if that brings you something.
 
Old 10-13-2006, 01:37 AM   #3
BiThian
Member
 
Registered: Aug 2006
Location: Romania
Distribution: NetBSD 3.1
Posts: 118

Original Poster
Rep: Reputation: 15
I saved it and now appeared another crontab.54354~ file, but this time filled (I guess I should have entered a newline at the end), but the problem remains: why isn't username file modified?

Last edited by BiThian; 10-13-2006 at 01:45 AM.
 
Old 10-13-2006, 10:31 AM   #4
BiThian
Member
 
Registered: Aug 2006
Location: Romania
Distribution: NetBSD 3.1
Posts: 118

Original Poster
Rep: Reputation: 15
I chose to use "crontab filename -u user". However, now I have another problem: can you tell me how to run a script as root, being logged as an ordinary user? And that without editing sudoers file or any suid. Thanks.
LE: From crontab, of course

Last edited by BiThian; 10-13-2006 at 10:40 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab doesn't work, but everything is set correctly ttilt Linux - General 10 06-16-2005 05:44 PM
useradd: invalid username username$ engyeow Fedora 5 12-05-2004 04:35 AM
work with crontab juanb Linux - General 1 06-05-2004 09:29 AM
crontab does not work need help Xris718 Linux - General 10 04-18-2004 08:55 PM
crontab won't work John Galt Linux - General 32 08-20-2003 01:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration