cron problem (duplicate mencoder jobs)?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users cron problem (duplicate mencoder jobs)?
# 1  
Old 06-24-2008
cron problem (duplicate mencoder jobs)?

Hello - Please forgive me is this is the incorrect forum for this post ...

I have a Hauppauge PVR-500 ("dual PVR-150") TV tuner card, installed under Ubuntu 8.04 LTS (64-bit). I wrote a simple bash script to record programs using the /dev/video0 or/and the /dev/video1 cards. I use a separate script to schedule recording times, using "at commands," that are executed by my local crontab (user crontab -e).

I've noticed that if I schedule simultaneous recordings in cron, I run into problems, e.g. one recording won't start until the first is complete, if both are schedules to start at the same time, and end at the same time. If I "nest" one recording (e.g. 30 minutes on tuner 1) that occurs after a longer recording (e.g. 2 hours) on tuner 0) has started, then the one on tuner 1 records successfully, but the one on tuner 2 does not quit but rather continues to re-record, continually overwriting the intended recording.

When I check my running processes (system activity), I see that one or two instances of mencoder are still running (I'm typing this from memory, at work).

I believe that this is a cron / process ID (pid) / scheduling conflict. I did a lot of Google searches (e.g.: cron, mencoder, simultaneous, scheduling, conflicts, fifo, tee, etc.) but I am unable to see a simple explanantion / solution.

Can anyone address the issue of how to get two instances of mencoder to operate, simultaneously, without interfering / conflicting with one another? For example, could I specify unique PID's (how?)? ...

Thank you, appreciated! Greg :-)
# 2  
Old 06-25-2008
Partially "resolved" ...

This is interesting ... I've been playing with test recordings of 1 min 5 sec, simultaneously programming captures from /dev/video0 (PVR-500 tuner 1) and /dev/video1 (PVR-500 tuner 2), using mencoder encoded in one bash file, and scheduled via "at" commands in a second bash script.

When I do it as described, the first recording executes and completes, then a little more than a minute after the intended start time, the second recording starts and executes.

I then repeated this, *but* I left Ubuntu's System Monitor (System > Administration > System Monitor) *open,* so that I could watch what was happening. By leaving the System Monitor window open, *two* separate mencoder processes launched, simultaneously. Both scheduled programs recorded, *simultaneously!*

This is not the case, if the System Monitor window is closed, and opened after the start time for the scheduled recordings have started: onlu one mencoder process is present, leading to the behavior desribed at the top of this reply.

Weird, huh?! Comments; solutions? ...
# 3  
Old 06-25-2008
Update ...

The behavior with having the System Monitor window open was not reproducible, all of the time. I added a "sleep 1" command before the mencoder line in one of the scripts; this seems to work, allowing simultaneous recordings to start at the 'same' time.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Cron jobs

I'm running cronjobs on a redhat 5.X. Cronjobs are getting failed frequently so how to find the root cause (2 Replies)
Discussion started by: karthik9358
2 Replies

2. Solaris

Cron jobs and at jobs

There are two jobs in Solaris , Cron and at jobs.. I know how to disable or enable cron jobs. How can I enable at jobs and disable it. Kindly help. Rj (2 Replies)
Discussion started by: jegaraman
2 Replies

3. UNIX for Dummies Questions & Answers

cron jobs

Hi, We have a group of hosts using which the cron jobs are submitted... Few days ago i had submitted a cron job in of these hosts, but unfortunately forgot the host name :( Can anyone please help me out in finding this host name from which the cron s submitting the job, i dont want the... (2 Replies)
Discussion started by: bhavanisree
2 Replies

4. Solaris

cron jobs

how to Put a cron entry which should be same script triggered on every Saturday and 1st of every month at 01.00 GMT. 0 2 1 * 6 --( At 2.00 GMT every sat & on 1st of every month) the above syntax is correct? Thanks (1 Reply)
Discussion started by: kurva
1 Replies

5. UNIX for Advanced & Expert Users

cron jobs...

I need to start a job every friday night at 8:00 P.M , it runs all the day on Sat and Sun....can somebody tell me how to do this...I understand crontab...but haven't used it.........can u write some steps.....how to create a file and call.....I honestly dont know? Plz help.Thanks (2 Replies)
Discussion started by: RubinPat
2 Replies

6. Linux

cron jobs

I created a php script. I'd like to have it run as a cron job every day at 10:30am. So i added 30 10 * * * /script.php to the cron file Is it possible to run the script on the command line to test it out ? (1 Reply)
Discussion started by: dannyd
1 Replies

7. HP-UX

Cron jobs

i am new for cronjobs can someone please tell me what logic is behind these RED Numbers and stars below? --> crontab -l 00 1 * * * /home/scripts/TarprodContent > /tmp/MprodBkup.log 2>&1 00 1 * * * /home/scripts/TarTprodContent > /tmp/TprodBkup.log 2>&1 00 1 * * *... (5 Replies)
Discussion started by: ajadaun
5 Replies

8. UNIX for Dummies Questions & Answers

Cron Jobs

Where can someone find info on Cron Jobs? Very new to UNIX and the PC I inherited looks to have several of them. Looks like they are some kind of background program that runs automatically at specified times. Would like to delete some of them and know more about them. (6 Replies)
Discussion started by: dereckbc
6 Replies

9. UNIX for Dummies Questions & Answers

cron jobs

I was wondering if itīs possible to cron job not to run on a certian day and time. Iīve got a job that runs everyday at 08:00 but would like it not to run on the 20:th between 08:00 and 10:00 Anyone know if this is possible, and if. How do i do it? regards... dOzY (3 Replies)
Discussion started by: dozy
3 Replies

10. Shell Programming and Scripting

cron jobs

hi folks, I need an explanation on cron jobs with an example (4 Replies)
Discussion started by: vijaysabari
4 Replies
Login or Register to Ask a Question