LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2013, 12:51 AM   #1
Ankush Seth
LQ Newbie
 
Registered: Sep 2013
Posts: 20

Rep: Reputation: Disabled
Problem with crontab:: command not executed properly via crontab


Hello All,
I am working with crontab and it is working fine until i run this command
*/1 * * * * cd /opt/lammp/myDir ;tscbrmuxer b:3008 pat.ts b:1500 sdt.ts b:1400 nit.ts b:9771076 null.ts b:2300000 firstvideo.ts b:188000 firstaudio.ts b:3008 pmt.ts b:3008 ait.ts b:1000000 emrc/EMMRC_Application.ts >myfirstfifo.ts & tsstamp myfirstfifo.ts 13271000 > mysecondfifo.ts & DtPlay mysecondfifo.ts -r 13271000 -t 107 -mt DVBS -mf 1140.0 -mc 3/4


when i run this command directly without crontab..it is working .But when running via crontab it is not running. I don't know what is going wrong. Please help me ,I will be highly thankful to you
 
Old 11-11-2013, 01:42 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
1. sheesh; put that in script and call the script instead.

2. the main issue with cron is that jobs in that env do NOT (usually) have the same env as the login env of that users.
Either source the correct env from your home dir or specify complete/absolute paths to all cmds & files.

HTH
 
Old 11-11-2013, 03:04 AM   #3
Ankush Seth
LQ Newbie
 
Registered: Sep 2013
Posts: 20

Original Poster
Rep: Reputation: Disabled
thanx for your reply chrism01.but i can't do this.because it will be very complicated for me to handle things
 
Old 11-11-2013, 03:06 AM   #4
Ankush Seth
LQ Newbie
 
Registered: Sep 2013
Posts: 20

Original Poster
Rep: Reputation: Disabled
and i have also changed the desired directory.......so there must be no problem
 
Old 11-11-2013, 03:09 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Have you checked the mail of the crontab's owner to see if some error message from cron has been received? In ant case, what Chris pointed out is that it's a good habit to use absolute paths for command and file names in crontab entries. For example, where the command tscbrmuxer is located on your system? If it's not in /bin or /usr/bin, crontab cannot find it, unless you specify its absolute path.
 
1 members found this post helpful.
Old 11-11-2013, 04:21 AM   #6
Ankush Seth
LQ Newbie
 
Registered: Sep 2013
Posts: 20

Original Poster
Rep: Reputation: Disabled
i agree...with you sir....and i have also tried to put all code in particular script. but again when that script is run by cron it is not working whereas when that script is run manually works fine.I can't understand this...please provide me the solution and command tscbrmuxer is set in system variable.
 
Old 11-11-2013, 04:33 AM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Please, show us the output of the command:
Code:
which tscbrmuxer tsstamp
 
1 members found this post helpful.
Old 11-11-2013, 05:42 AM   #8
Ankush Seth
LQ Newbie
 
Registered: Sep 2013
Posts: 20

Original Poster
Rep: Reputation: Disabled
Normal output without crontab


output bitrate: 13271000.000000
new pid entry 0
new pid entry 17
new pid entry 16
new pid entry 8191
new pid entry 2064
new pid entry 2068
new pid entry 1031
new pid entry 2001
new pid entry 2003

Start playing
- Play file name : mysecondfifo.ts
- Loop file : 1x
- Transport-Stream rate : 13271000 bps
- Transmit Mode : 188
- Output device : DTA-107 (#1)
- Modulation Type : QPSK
- Carrier Frequency : 1140.00 MHz
- Output Level : -27.5 dBm
- Convolutional Rate : 3/4

with crontab output=

mytext.sh: 1: tsstamp: not found

Start playing
- Play file name : mysecondfifo.ts
- Loop file : 1x
- Transport-Stream rate : 13271000 bps
- Transmit Mode : 188
- Output device : DTA-107 (#1)
- Modulation Type : QPSK
- Carrier Frequency : 1140.00 MHz
- Output Level : -27.5 dBm
- Convolutional Rate : 3/4
 
Old 11-11-2013, 05:59 AM   #9
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by Ankush Seth View Post
mytext.sh: 1: tsstamp: not found
This confirms that the command tsstamp is not in the cron PATH. Now check the absolute paths of the two commands using
Code:
which tscbrmuxer tsstamp
and use them to invoke the two programs inside your script or in the crontab entry.
 
1 members found this post helpful.
Old 11-11-2013, 06:17 AM   #10
Ankush Seth
LQ Newbie
 
Registered: Sep 2013
Posts: 20

Original Poster
Rep: Reputation: Disabled
but ouput of above code is this


/usr/local/bin/tscbrmuxer
/usr/local/bin/tsstamp
 
Old 11-11-2013, 06:21 AM   #11
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by Ankush Seth View Post
but ouput of above code is this


/usr/local/bin/tscbrmuxer
/usr/local/bin/tsstamp
At this point put these paths in your script or in the crontab entry. For example in crontab:
Code:
0 * * * * cd /opt/lammp/myDir; /usr/local/bin/tscbrmuxer b:3008 pat.ts b:1500 sdt.ts b:1400 nit.ts b:9771076 null.ts b:2300000 firstvideo.ts b:188000 firstaudio.ts b:3008 pmt.ts b:3008 ait.ts b:1000000 emrc/EMMRC_Application.ts > myfirstfifo.ts && /usr/local/bin/tsstamp myfirstfifo.ts 13271000 > mysecondfifo.ts && /usr/local/bin/DtPlay mysecondfifo.ts -r 13271000 -t 107 -mt DVBS -mf 1140.0 -mc 3/4
I noticed there is another command in your code (DtPlay) and I assumed it's placed in /usr/local/bin as well, but you can check to be sure.
 
1 members found this post helpful.
Old 11-11-2013, 06:25 AM   #12
Ankush Seth
LQ Newbie
 
Registered: Sep 2013
Posts: 20

Original Poster
Rep: Reputation: Disabled
thank you very much sir.....you solved my biggest problem...i am thankful to you sir..and lucky to have your guidence
 
  


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
ShellScript executed from command prmpt but not executed from crontab or at command BMMadhav Linux - Newbie 1 11-16-2012 07:20 PM
Crontab is not working properly on CentOS 6.3 miguelangeljma Linux - Newbie 12 09-30-2012 10:56 PM
[SOLVED] Shutdown in Crontab not executed RagingRaven Linux - Newbie 10 09-18-2011 07:26 AM
"ps" command not executed in script when using crontab Annielover Linux - General 6 06-06-2011 02:22 PM
Specific Crontab Job is not executed . Itsik Harel Linux - Server 1 03-11-2007 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration