LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-09-2008, 05:40 PM   #1
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
script won't run in crontab(centos 5)


I have a sox|lame one line script that has served me well on other distros of linux but for some reason it will not work on my centos 5 PC.

script records from line in using sox then I pipe it through lame to re-encode it.

I've tried

37 17 09 3 * sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | lame -x -m s - ~/test`date +%b%d_%Y`.mp3

37 17 09 3 * sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | lame -x -m s - ~/test'date +%b%d_%Y'.mp3


the problem is with the 'date +%b%d_%Y' portion.


I get this in mail

sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | lame -x -m s - ~/test'date +
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/username>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=username>
X-Cron-Env: <USER=username>

/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file



both scripts fail with the same basic message.

basically I want the script to add the date/time/etc to a filename.


thanks!
 
Old 03-09-2008, 06:08 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Try $(date +%b%d_%Y) and maybe put the file name in "" (~/"test$(date +%b%d_%Y).mp3".)
ta0kira
 
Old 03-09-2008, 07:55 PM   #3
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
Ok I found a work around. I tested the script in the terminal and it work. I'll just throw it in a file and run the file from cron.


thanks!




sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | lame -x -m s - ~/test`date +%b%d_%Y`.mp3
 
  


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
my database export shell script run from command line but not form crontab saifee Linux - General 11 01-29-2012 10:24 AM
Script run by crontab won't send email Braynid Linux - Newbie 1 12-21-2007 01:16 AM
Crontab -e doesnt run my script ! c0nsur Linux - General 4 08-04-2005 12:21 AM
crontab failure: permission denied trying to run script hedpe Linux - Software 5 05-03-2005 08:07 PM
Script doesn't run in crontab dani81 Linux - General 1 11-16-2004 04:42 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:54 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