cron job change

Discussions about new features or changes in existing features

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

cron job change

Postby spaquet » Wed May 26, 2010 12:58 pm

I noticed that some jobs are more time and CPU consuming than others.

I focused my attention on record compression and noticed that this job is run every 3 minutes. I think this is not the best way to deal with that and I suggest the following changes:

1. Once a day compression and transfer of compressed files:
Code: Select all
*/4 08-22 * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl
00  02    * * * /usr/share/astguiclient/AST_CRON_audio_2_compress.pl --MP3

2. In stead of having several processes (one per task at the moment) it could be easier to manage the operation flow by having a single executable file to deal with all operation (ranging from mixing to transfer).

3. It would be great to have a security to insure that the process is not already running. This would prevent 2 or more compression process to run at the same time, situation that can lead to crash the server when they come competing with one an other for the same resources.
spaquet
 
Posts: 105
Joined: Sat May 30, 2009 7:05 am
Location: Morocco

Postby williamconley » Wed May 26, 2010 6:23 pm

there are many versions and opinions on the topic. the issue is availability of the files: if you have the need to listen to a recording a few minutes after it is made (to verify a sale, for instance), then once a day is not entirely suitable.

if you wanted to create an area in the server GUI where preferences such as this would be easily stored, that would help out with the management of the sound manipulation. right now, of course, it is left to the individual to decide how often/what format/when to push to storage server, etc.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby spaquet » Thu May 27, 2010 9:06 am

Totally agree.

I will try to have some kind of lock to prevent 2 or more identical process to be run at the same time.
spaquet
 
Posts: 105
Joined: Sat May 30, 2009 7:05 am
Location: Morocco

Postby williamconley » Thu May 27, 2010 10:01 am

you can just have that particular item begin with a system call to see if it's already running
Code: Select all
ps -A | grep XXXX

works fairly well for this. if it's already running, just don't start another one
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby spaquet » Sat Jun 19, 2010 9:29 am

Just great idea.
Faster and more reliable in case of system restart than a lock.
spaquet
 
Posts: 105
Joined: Sat May 30, 2009 7:05 am
Location: Morocco


Return to Features

Who is online

Users browsing this forum: No registered users and 62 guests