Cron running at 1 am , which make all logout ?

General support questions including new installations

Cron running at 1 am , which make all logout ?

Postby gmcust3 » 2010/02/24 01:22:44

I use asterisk and CentOS.

Code: Select all

[root@vici ~]# crontab -l
### recording mixing/compressing/ftping scripts
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astgu iclient/AST_CRON_audio_1_move_mix.pl
#0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astg uiclient/AST_CRON_audio_1_move_VDonly.pl
#1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58 * * * * /usr/share/ast guiclient/AST_CRON_audio_2_compress.pl --GSM
#2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59 * * * * /usr/share/ast guiclient/AST_CRON_audio_3_ftp.pl --GSM

### keepalive script for astguiclient processes
* * * * * /usr/share/astguiclient/ADMIN_keepalive_ALL.pl

### kill Hangup script for Asterisk updaters
* * * * * /usr/share/astguiclient/AST_manager_kill_hung_congested.pl

### updater for voicemail
* * * * * /usr/share/astguiclient/AST_vm_update.pl

### updater for conference validator
* * * * * /usr/share/astguiclient/AST_conf_update.pl

### flush queue DB table every hour for entries older than 1 hour
11 * * * * /usr/share/astguiclient/AST_flush_DBqueue.pl -q

### fix the vicidial_agent_log once every hour
33 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl

### updater for VICIDIAL hopper
* * * * * /usr/share/astguiclient/AST_VDhopper.pl -q

### adjust the GMT offset for the leads in the vicidial_list table
1 1 * * * /usr/share/astguiclient/ADMIN_adjust_GMTnow_on_leads.pl --debug

### reset several temporary-info tables in the database
2 1 * * * /usr/share/astguiclient/AST_reset_mysql_vars.pl

### optimize the database tables within the asterisk database
3 1 * * * /usr/share/astguiclient/AST_DB_optimize.pl

## adjust time on the server with ntp
30 * * * * ntpdate -u ntp.myfloridacity.us 2>/dev/null 1>&2

### VICIDIAL agent time log weekly and daily summary report generation
2 0 * * 0 /usr/share/astguiclient/AST_agent_week.pl
22 0 * * * /usr/share/astguiclient/AST_agent_day.pl

### VICIDIAL campaign export scripts (OPTIONAL)
#32 0 * * * /usr/share/astguiclient/AST_VDsales_export.pl
#42 0 * * * /usr/share/astguiclient/AST_sourceID_summary_export.pl

### remove old recordings more than 7 days old
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -m time +7 -print | xargs rm -f

### remove old vicidial logs and asterisk logs more than 2 days old
28 0 * * * /usr/bin/find /var/log/astguiclient -maxdepth 1 -type f -mtime +2 -pr int | xargs rm -f
29 0 * * * /usr/bin/find /var/log/asterisk -maxdepth 3 -type f -mtime +2 -print | xargs rm -f
30 0 * * * /usr/bin/find / -maxdepth 1 -name "screenlog.0*" -mtime +4 -print | x args rm -f
51 5 * * * /etc/webmin/cron/tempdelete.pl
[root@vici ~]#


[Moderator edit: s/CODE/code/]

All my user gets automatically logout at 1 am EST.

What could be the reason ?
gmcust3
 
Posts: 170
Joined: 2009/10/28 19:44:35

Re: Cron running at 1 am , which make all logout ?

Postby abednegoyulo » 2010/02/24 01:32:10

I would suggest

1) Read the logs to determine what is causing the logouts
2) Review the scripts that run on 1am

Wikipedia has a nice article on cron. Please read it so that you can determine for yourself which of the cron jobs are being executed 1 in the morning. Just to point out one very obvious fact, the cron depends on the time of the box.
abednegoyulo
 
Posts: 550
Joined: 2007/12/26 06:24:38
Location: 127.0.0.2 44013

Cron running at 1 am , which make all logout ?

Postby pschaff » 2010/02/24 01:36:35

That's really an Asterisk question, not a CentOS question.
http://wiki.centos.org/AdditionalResources/OtherVoices

Perhaps somebody here knows anyway; however I see only 3 crontab entries with hour "1" so that should narrow the search parameters.
pschaff
Retired Moderator
 
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: Cron running at 1 am , which make all logout ?

Postby gmcust3 » 2010/02/24 02:01:07

### adjust the GMT offset for the leads in the vicidial_list table
1 1 * * * /usr/share/astguiclient/ADMIN_adjust_GMTnow_on_leads.pl --debug

### reset several temporary-info tables in the database
2 1 * * * /usr/share/astguiclient/AST_reset_mysql_vars.pl

### optimize the database tables within the asterisk database
3 1 * * * /usr/share/astguiclient/AST_DB_optimize.pl


Either of One from above is causing an issue ?

I am from India and we dial USA and UK using Asterisk. I got an advice from Vici group as :

You need to set EVERYTHING to your local time zone.


[root@vici ~]# date ; date -u ; /sbin/hwclock --show
Tue Feb 23 21:07:12 EST 2010
Wed Feb 24 02:07:12 UTC 2010
Tue 23 Feb 2010 09:07:14 PM EST -0.655274 seconds
[root@vici ~]#


1) My above times are Ok ??

2) If No , date and hwclock should be IST ?

3) I need to run SetUp and select Asia and all done by default ?

4) System clock to use UTC or not ?
gmcust3
 
Posts: 170
Joined: 2009/10/28 19:44:35

Re: Cron running at 1 am , which make all logout ?

Postby pschaff » 2010/02/24 13:51:46

gmcust3 wrote:
### adjust the GMT offset for the leads in the vicidial_list table
1 1 * * * /usr/share/astguiclient/ADMIN_adjust_GMTnow_on_leads.pl --debug

### reset several temporary-info tables in the database
2 1 * * * /usr/share/astguiclient/AST_reset_mysql_vars.pl

### optimize the database tables within the asterisk database
3 1 * * * /usr/share/astguiclient/AST_DB_optimize.pl


Either of One from above is causing an issue ?

Certainly seems likely from the symptoms you describe, except for possible confusion about the time.

I am from India and we dial USA and UK using Asterisk. I got an advice from Vici group as :

You need to set EVERYTHING to your local time zone.


Don't know what is meant by EVERYTHING in this context. AFAIK the only candidates for inclusion in "EVERYTHING" are system time and hardware clock.

[root@vici ~]# date ; date -u ; /sbin/hwclock --show
Tue Feb 23 21:07:12 EST 2010
Wed Feb 24 02:07:12 UTC 2010
Tue 23 Feb 2010 09:07:14 PM EST -0.655274 seconds
[root@vici ~]#


1) My above times are Ok ??

No.

2) If No , date and hwclock should be IST ?

The usual approach for *nix systems is to set the hardware clock to UTC and the system date/time to the local time zone; however, this seems to contradict the "EVERYTHING" advice you got elsewhere. You seem to be using US Eastern Standard Time rather than local time.

3) I need to run SetUp and select Asia and all done by default ?

Asia is a big place. I would assume you have a more specific local time. I would put the hardware clock on UTC and set the local time zone appropriately (IST?).

4) System clock to use UTC or not ?

See above.

Not sure what any of this has to do with users getting logged off unless the time settings are somehow causing something in the system to think a long time has elapsed and users are logged out due to incorrectly calculated inactivity, If still having problems after setting the local time correctly the next thing to try would be to set the hardware clock to local time, but that sounds like it may be necessitated by an Asterisk bug.
pschaff
Retired Moderator
 
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: Cron running at 1 am , which make all logout ?

Postby gmcust3 » 2010/02/24 16:27:34

Here is what I have now , after changing it :

Code: Select all

[root@vici ~]# date ; date -u  ; /sbin/hwclock --show
Wed Feb 24 21:54:45 IST 2010
Wed Feb 24 16:24:45 UTC 2010
Wed 24 Feb 2010 09:54:47 PM IST  -0.479860 seconds
[root@vici ~]#




The usual approach for *nix systems is to set the hardware clock to UTC and the system date/time to the local time zone; however, this seems to contradict the "EVERYTHING" advice you got elsewhere. You seem to be using US Eastern Standard Time rather than local time.


1) So, /sbin/hwclock should be date -u ?

2) /sbin/hwclock resets BIOS time also ?
gmcust3
 
Posts: 170
Joined: 2009/10/28 19:44:35

Re: Cron running at 1 am , which make all logout ?

Postby pschaff » 2010/02/24 16:44:23

man hwclock
Code: Select all
...
       --systohc
              Set the Hardware Clock to the current System Time.
...


Looks OK now. On a system in EST timezone with hardware clock set to UTC:
Code: Select all
# date ; date -u  ; /sbin/hwclock --show
Wed Feb 24 11:42:18 EST 2010
Wed Feb 24 16:42:18 UTC 2010
Wed 24 Feb 2010 11:42:19 AM EST  -0.232463 seconds
pschaff
Retired Moderator
 
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: Cron running at 1 am , which make all logout ?

Postby gmcust3 » 2010/02/24 16:53:31

/sbin/hwclock resets BIOS time also ?
gmcust3
 
Posts: 170
Joined: 2009/10/28 19:44:35

Re: Cron running at 1 am , which make all logout ?

Postby pschaff » 2010/02/24 17:07:18

That is the hardware clock time. It is set using the option shown in my last post.
pschaff
Retired Moderator
 
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: Cron running at 1 am , which make all logout ?

Postby gmcust3 » 2010/02/25 17:03:32

If My local time zone is IST, Do I need below line in cron root ? :

## adjust time on the server with ntp
30 * * * * ntpdate -u ntp.myfloridacity.us 2>/dev/null 1>&2
gmcust3
 
Posts: 170
Joined: 2009/10/28 19:44:35

Next

Return to CentOS 5 - General Support

Who is online

Users browsing this forum: No registered users and 2 guests