Should have just left it alone!

4 replies [Last post]
allanayr
Offline
Ayr, United Kingdom
Joined: 25 Sep 2011

After many months of just running along in the background I recently decided to write a little lua script. No doubt due to my poor programming it was leaking memory and eventually caused the inevitable crash :-(

Before I had realised what the problem was I had tried to edit the cron and the lack of memory caused my cron file to be overwritten with a blank file. I've recovered the cron file but I am having trouble re-connecting the cron file with it's link in the /var/spool/cron/crontabs directory.

As I understand it the file in /var/spool/cron/crontabs should be a symlink to /etc/crontabs/root and should have permissions 1rwxrwxrwx. I've tried several methods to get the system setup in this fashion but nothing seems to work. Now when I edit the cron using crontab -e the file is shown as being /var/spool/cron/crontabs.xxx This works OK but I get the feeling it may cause me further grief in future.

I've tried:

crontab root

stopping and restarting crond

rebooting

creating the symlink manually

deleting the root file and starting from a blank file

and I'm still not able to get the file setup correctly.

Any pointers would be greatly appreciated.

Allan

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Alan, The correct way to edit

Alan,

The correct way to edit the crontab file is to invoke "crontab -e" this will fire up an editor and do the work once you exit the editor to get it in place.

Brett

allanayr
Offline
Ayr, United Kingdom
Joined: 25 Sep 2011
BrettThanks for this, I do

Brett

Thanks for this, I do invoke crontab -e to edit the cron file. The permissions on the /var/spool/cron/crontabs/root file are -rw------- I take it that it's not really an issue?

Allan

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Not a problem at all as the

Not a problem at all as the "cron" daemon run as root so it can read this.  In anycase it has u+rw access and the file will be owned by root.
Brett

allanayr
Offline
Ayr, United Kingdom
Joined: 25 Sep 2011
All good then.It's still a

All good then.

It's still a great system!

Thanks

Hardware Info