LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-01-2011, 04:31 AM   #1
samhill5215
Member
 
Registered: Apr 2011
Posts: 46

Rep: Reputation: 1
scheduling trouble on ubuntu server 10.10


I'm running Ubuntu 10.10 server with no graphics and would like to record video from my capture card. I can do that just fine with "sudo cat /dev/video0 > mycapture.mpg" but run into trouble when I include it in a script such as:

at 12pm << EoF
cat /dev/video > mycapture.mpg &
sleep 10
kill \$!
EoF

Running the script places the job in the at queue but no file is ever created and the job never terminates. It must be done explicitly with atrm. Thinking it was a permission problem I prefixed my script command with sudo to get around the fact that /dev/video0 is owned by root and changed the owner of /dev/video0 to my user name. Neither worked.

Not quite sure what's happening or where to look. Any help would be more than appreciated.
 
Old 06-01-2011, 04:12 PM   #2
spankbot
Member
 
Registered: Aug 2007
Posts: 133

Rep: Reputation: 16
Does the file "mycapture.mpg" already exist? If so you may be running into the "no clobber" shell feature. You could try turning noclobber off, or, have the name of your mpg file be unique each time the script is run...

Code:
cat /dev/video > mycapture-`date +%Y%m%d`.mpg &
The date command by itself simply prints out the date in the form YYYYmmdd. You can add a minute and second to that if your command runs more than once a day.

So
Code:
date +%Y%m%d
outputs...
Code:
20110601
 
Old 06-08-2011, 04:43 AM   #3
samhill5215
Member
 
Registered: Apr 2011
Posts: 46

Original Poster
Rep: Reputation: 1
Thanks for that spankbot. Actually, and I'm not sure why, using webmin's scheduled commands module fixed my problem. The strange thing is that webmin also uses AT for scheduling but since I'm running them as root I suspect the problem was tied to permissions. Isn't pretty much everything in linux so? Anyway the commands are:

v4l2-ctl -i 2
cat /dev/video0 > /media/recordings/<name-your-file>.mpg &
CAT_PID=$!
sleep <time-to-record>m
kill $CAT_PID
 
  


Reply


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
[SOLVED] Trouble updating ubuntu server 10.04 dpkg fails cyco Linux - Server 6 02-28-2011 03:42 PM
Trouble installing webmin on Ubuntu 7.10 server ed. Swerve1000 Linux - Server 1 02-08-2008 06:56 AM
Trouble starting Ubuntu Server 7.10 Plz help! vishal_pinglikar Linux - Server 4 12-18-2007 03:35 AM
Trouble with Domino 6.5 server on Ubuntu 7.04 arruah Ubuntu 0 05-10-2007 01:18 PM
Scheduling server and UPS shutdown klmn1 Linux - Software 0 06-19-2003 10:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:46 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration