You are not logged in.
I'm trying to create a crontab as a regular user and it's not working.
I type "crontab -e" and vim starts with a blank file called /var/tmp/crontab.something
I add the cron entry I want, save and exit.
I type "crontab -e" again and I'm looking at an empty file again
I'm in the "users" group.
/usr/bin/crontab is owned by root:users.
crond (dcron) is running and system crontabs are executed.
Any ideas?
Offline
'sudo crontab -e'?
Offline
'sudo crontab -e'?
... brings up root's crontab and the same behaviour occurs. If I edit and save it, my changes simply vanish.
Offline
Add yourself to the cron group?
No matter which cron package you use, if you want to allow a user to use crontab, he will first have to be in the cron group.
Last edited by tlvince (2010-07-20 11:02:44)
Offline
'sudo crontab -e -u karol'
From 'man crontab': Only users who belong to the same group as the crontab binary will be able to install or edit crontabs.
Last edited by karol (2010-07-19 11:12:56)
Offline
Are you sure that the temp file is in /var/tmp/ ?
Because mine goes to /tmp/
This might sound stupid but I just saw this in the wiki:
Cron should work "out-of-the-box" for most Arch Linux users. In order to use crontab, users must be members of a designated group, but in Arch Linux, that group is users, of which all users should already be members. If for whatever reason some users are not members of this group, they can be added to it with the command:
# gpasswd -a username users
Offline
@ sand_man
That is consistent with my understanding of this issue.
I can edit and the files doesn't disappear, stays as /tmp/crontab.kj7ngJ atm. It's still a tempfile, but it doesn't exhibit OPs problem
I type "crontab -e" again and I'm looking at an empty file again
Offline
Add yourself to the cron group.
Gentoo Wiki wrote:No matter which cron package you use, if you want to allow a user to use crontab, he will first have to be in the cron group.
There is no cron group and surely that wouldn't apply to root.
'sudo crontab -e -u karol'
From 'man crontab': Only users who belong to the same group as the crontab binary will be able to install or edit crontabs.
That doesn't work either and as I said in the initial post, /usr/bin/crontab is owned by root:users.
Are you sure that the temp file is in /var/tmp/ ?
Because mine goes to /tmp/
Definitely /var/tmp here.
Where do regular user crontab files go ordinarily? $HOME/.crontab? Maybe I could just create it manually and side-step this problem for now.
Offline
No they go in /var/spool/cron/
You don't need to be in the "cron" group. As you said, it doesn't exist. Gentoo != Arch.
What is the output of `groups`
Offline
Again, from the manpage: "The superuser also has his or her own per-user crontab, saved as /var/spool/cron/root."
[karol@black ~]$ l /var/spool/cron/
total 8,0K
-rw------- 1 68 07-19 13:28 karol
-rw------- 1 513 07-19 13:22 root
Which cron are you using:
[karol@black ~]$ pacman -Ss cron
core/dcron 4.4-2 [0,03 MB] (base) [installed]
dillon's lightweight cron daemon
extra/kdeadmin-kcron 4.4.5-1 [0,20 MB] (kde kdeadmin)
Configure and schedule tasks
community/adns 1.4-2 [0,08 MB]
adns is an asyncronous replacement resolver library
community/fcron 3.0.6-3 [0,13 MB]
feature-rich cron implementation
community/gnome-schedule 2.1.1-1 [1,16 MB]
GNOME frontend to cron and at
community/incron 0.5.9-1 [0,11 MB]
Like the regular cron but is driven by filesystem events instead of time periods
community/perl-datetime-cron-simple 0.2-4 [0,00 MB]
Perl/CPAN Module DateTime::Cron::Simple
community/wtf 20071004-2 [0,01 MB]
ancronym dictionary
Offline
What is the output of `groups`
lp wheel mpd video audio users vboxusers
@karol it's dcron
Well, I created a .crontab in my home directory, crossed my fingers and typed
crontab -l
... nothing - and not easy to type with crossed fingers
So then I tried
crontab .crontab
to replace the contents of my crontab with a file as the man page says you can do. Whaddaya know - it worked.
Thanks for all the replies. I'd like to know what's going on but for now at least I've found a way around it.
Offline
UPDATE
I just had to know what was causing this and after stabbing around in the dark for a while I tried
EDITOR=/usr/bin/nano crontab -e
and things worked as they should.
So the problem seems to be related to vim. Weird.
Offline
UPDATE
I just had to know what was causing this and after stabbing around in the dark for a while I tried
EDITOR=/usr/bin/nano crontab -e
and things worked as they should.
So the problem seems to be related to vim. Weird.
I had some problems with crontab awhile back and it was due to vi not vim. The default editor was vi and (I cannot remember exactly now) think it had some issue with my CLI environment.
The simple solution I gave it was to use vim by editing my .bashrc and adding an alias like so: alias vi='vim'
From there on vim was used and problem solved.
Hope this may be of help too.
R.
Offline
I had some problems with crontab awhile back and it was due to vi not vim. The default editor was vi and (I cannot remember exactly now) think it had some issue with my CLI environment.
The simple solution I gave it was to use vim by editing my .bashrc and adding an alias like so: alias vi='vim'From there on vim was used and problem solved.
Hope this may be of help too.
R.
Thank you. Based on your post I tried some things with aliases which didn't help and then installed vi and it started working. I don't understand this at all but I know to keep vi installed now.
Can someone confirm this behaviour? I don't think I've done anything odd to my system to cause this. Might be a bug.
Last edited by jaloz (2010-07-19 14:53:37)
Offline
It may be a bug (I do not know for sure) but ... it may be not. Like I said, vi is the default editor for crontab, so may be your problems stated because you did not have it in the first place.
In my case I did have vi but it was causing me grief so I aliased it to vim and it worked fine after that.
R.
Offline