Page 1 of 2

Cron running at 1 am , which make all logout ?

Posted: 2010/02/24 01:22:44
by gmcust3
I use asterisk and CentOS.

[code]

[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 ~]#

[/code]
[Moderator edit: s/CODE/code/]

All my user gets automatically logout at 1 am EST.

What could be the reason ?

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

Posted: 2010/02/24 01:32:10
by abednegoyulo
I would suggest

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

[url=http://en.wikipedia.org/wiki/Cron]Wikipedia[/url] 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.

Cron running at 1 am , which make all logout ?

Posted: 2010/02/24 01:36:35
by pschaff
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.

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

Posted: 2010/02/24 02:01:07
by gmcust3
### 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 :

[quote]
You need to set EVERYTHING to your local time zone.
[/quote]

[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 ?

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

Posted: 2010/02/24 13:51:46
by pschaff
[quote]
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 ?
[/quote]
Certainly seems likely from the symptoms you describe, except for possible confusion about the time.

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

[quote]
You need to set EVERYTHING to your local time zone.
[/quote]
[/quote]
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.

[quote]
[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 ??
[/quote]
No.

[quote]
2) If No , date and hwclock should be IST ?
[/quote]
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.

[quote]
3) I need to run SetUp and select Asia and all done by default ?
[/quote]
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?).

[quote]
4) System clock to use UTC or not ?[/quote]
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.

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

Posted: 2010/02/24 16:27:34
by gmcust3
Here is what I have now , after changing it :

[code]

[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 ~]#

[/code]


[quote]
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.
[/quote]

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

2) /sbin/hwclock resets BIOS time also ?

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

Posted: 2010/02/24 16:44:23
by pschaff
man hwclock[code]
...
--systohc
Set the Hardware Clock to the current System Time.
...
[/code]

Looks OK now. On a system in EST timezone with hardware clock set to UTC:
[code]
# 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
[/code]

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

Posted: 2010/02/24 16:53:31
by gmcust3
/sbin/hwclock resets BIOS time also ?

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

Posted: 2010/02/24 17:07:18
by pschaff
That [b]is[/b] the hardware clock time. It is set using the option shown in my last post.

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

Posted: 2010/02/25 17:03:32
by gmcust3
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