Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-19-2012, 07:38 AM
|
#1
|
|
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,634
|
Crontab: Cannot see entries, but execution running
Hello friends!
It's very strange! I had deployed a script in crontab on my system (Sun Solaris 5.8). I was able to check my crontab entries few days ago. But suddenly I found there's nothing in crontab.
If I do:
Code:
crontab -l
crontab: can't open your crontab file.
And if I invoke:
It opens an empty file.
Well, scripts are still running (as they were scheduled) fine. I am surprized where're my crontab entries? If crontab -l isn't showing them then how they're running...
Can anyone help?
|
|
|
|
12-19-2012, 07:45 AM
|
#2
|
|
Moderator
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.4 OpenSuSE 12.2
Posts: 9,897
|
Are you looking at the crontab of the right user? Maybe you did set up the root's crontab and now you're looking at a normal user's crontab. Just a guess.
|
|
|
|
12-19-2012, 08:01 AM
|
#3
|
|
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,634
Original Poster
|
Hi colucix,
I do not have root access on this server, but I use only my own account only.
|
|
|
|
12-19-2012, 09:40 PM
|
#4
|
|
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,634
Original Poster
|
It's really surprising. There's no entry showing in crontab (crontab -l), but it's still running...
I want to rename a script, so I need to modify the same in cron also.
I do not wish to add new entries, without deleting previous ones, or just want to modify existing ones. Any help please...
|
|
|
|
12-20-2012, 02:56 AM
|
#5
|
|
Moderator
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.4 OpenSuSE 12.2
Posts: 9,897
|
Hi shivaa. Any clue from the system logs (maybe you have to ask the system administrator to view them)? Also check in /var/spool/cron/crontabs where the actual users' crontabs are stored.
|
|
|
|
12-20-2012, 03:31 AM
|
#6
|
|
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,634
Original Poster
|
Hi colucix,
Unfortunately cron logs do not have read permissions for me. So I can read neither /var/spool/cron/crontabs nor /var/cron/log.
But one thing, this is a generic Unix account (named, saldap) and is shared between us 3 guys. Although, I cannot see any file with name saldap in /var/spool/cron/crontabs, so I doubt one of other 2 guys has removed cron entries (I guess he invoked, crontab -r)... But first need to confirm with them.
Meanwhile, if crontab entries have removed, then how it's still working? Does it save those entreis somewhere in memory or cache...?
|
|
|
|
12-20-2012, 04:26 AM
|
#7
|
|
Moderator
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.4 OpenSuSE 12.2
Posts: 9,897
|
Quote:
Originally Posted by shivaa
Meanwhile, if crontab entries have removed, then how it's still working? Does it save those entreis somewhere in memory or cache...?
|
Doubtfully. This means that users cannot truly remove their own crontab. Only the system administrator can save the jobs somewhere else. Another option is that jobs didn't actually terminate and run continuously since their first execution, but you should be aware of that.

|
|
|
|
12-20-2012, 06:44 AM
|
#8
|
|
Member
Registered: Dec 2012
Location: Tampa, FL
Distribution: Slackware, FreeBSD, CentOS
Posts: 37
Rep: 
|
I don't know if it's the same in solaris but in linux there is a directory called /etc/crond.d/ and /etc/cron.daily/|weekly/|monthly/. Scripts in those directories will run just like any other cron job but you won't see them with crontab -l. Maybe an admin moved the script to one of those directories if they didn't just directly add it to the root account or something.
Try running ps -axf around the time the cron job runs to see what user is running it.
Last edited by wstewart; 12-20-2012 at 06:57 AM.
|
|
|
|
12-20-2012, 06:57 AM
|
#9
|
|
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,634
Original Poster
|
@wstewart: Admin didn't make any changes. And there's no /etc/cron.d in my Solaris system, but only cron.deny.
@colucix: I checked with my collegue and he admitted that he had tried to make some changes. Actually he tried to edit crontab on CLI and his default editor was not set, so it couldn't work properly. He then tried ^C and ^D to exit from that... Rest he do not remember what happened.
Anyway, I am quite sure that something went wrong when he tried to modify crontab.
My scripts periodically update some log files and send a mail everyday, which is still working fine. And it means, somewhere my cron entries are still working. Though I am now thinking to do a crontab -r to clean it and then will add the same entries again. But before this, I want to be assured that no any cron jobs are runing for the user saldap.
|
|
|
|
12-20-2012, 07:56 AM
|
#10
|
|
Moderator
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.4 OpenSuSE 12.2
Posts: 9,897
|
It's weird you don't see the saldap entry in /var/spool/cron/crontabs. You can try to modify the EDITOR environment variable to see if something changes, but at this point I think only the sys admin with root privileges can restore a previous working situation.
|
|
|
|
12-20-2012, 08:33 AM
|
#11
|
|
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,634
Original Poster
|
Hi colucix,
As you know that file in /var/spool/cron/crontabs, corresponding to the particular user, gets deleted when user or root runs a crontab -r for that user. Since the file i.e. saldap isn't their, so I guess someone has invoked crontab -r... don't know whether intentionally or unintentionally.
Since we very rarely use this server & account, and it's my mistake that I didn't set the EDITOR variable for user saldap, but whenever needed I set it manually (but my collegue was not aware about this).
Anyway, now the question is that, does deleted cron entires goes in any cache or some tmp file...? I really do not understand this behaviour 
|
|
|
|
02-18-2013, 02:38 AM
|
#12
|
|
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,634
Original Poster
|
I found that cron stores or keeps it's entries for some time into cache.
Thanks everyone! Ciao!!
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:31 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|