LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 12-19-2012, 07:38 AM   #1
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
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:
Code:
crontab -e
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?
 
Old 12-19-2012, 07:45 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
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.
 
Old 12-19-2012, 08:01 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
Hi colucix,

I do not have root access on this server, but I use only my own account only.
 
Old 12-19-2012, 09:40 PM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
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...
 
Old 12-20-2012, 02:56 AM   #5
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
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.
 
Old 12-20-2012, 03:31 AM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
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...?
 
Old 12-20-2012, 04:26 AM   #7
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Quote:
Originally Posted by shivaa View Post
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.

 
Old 12-20-2012, 06:44 AM   #8
wstewart
Member
 
Registered: Dec 2012
Location: Tampa, FL
Distribution: Slackware, FreeBSD, CentOS
Posts: 41

Rep: Reputation: 1
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.
 
Old 12-20-2012, 06:57 AM   #9
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
@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.
 
Old 12-20-2012, 07:56 AM   #10
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
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.
 
Old 12-20-2012, 08:33 AM   #11
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
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
 
Old 02-18-2013, 02:38 AM   #12
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Original Poster
Rep: Reputation: 285Reputation: 285Reputation: 285
I found that cron stores or keeps it's entries for some time into cache.
Thanks everyone! Ciao!!
 
  


Reply

Tags
crontab, entry, lost


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab execution + log argie01 Linux - Software 7 01-03-2013 12:34 PM
Where are the crontab entries stored? abefroman Linux - Server 2 11-15-2006 02:28 PM
Crontab doesn't accept new entries Thakowbbery Linux - Software 5 08-22-2006 01:49 PM
crontab entries will not execute when not logged fatra2 Linux - Software 2 05-23-2006 02:22 AM
randomizing execution of some cron entries markus1982 Linux - General 2 06-28-2003 09:49 AM


All times are GMT -5. The time now is 10:00 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration