Cron problems
I'm still trying to nail down the problem and hopefully someone can help me.
When I run my code from the terminal, it works. When it is run from Cron, there is no recording. The file is created but when I open it, nothing. No sound, and the file size stays at 44k. When I run from the terminal, I can see the file size increasing when I look at it from a thunar window. Any idea what is going on and what I should do? This is the code I am using: Code:
arecord -t wav -f cd -d 44 /home/randy/chuo-radio-shows/testaudioJUN0514.wav Code:
I am using LinuxLite 2.0 which is based on Ubuntu 14.04 |
Tried using full path to arecord?
|
Usually when a command works from the terminal but not from cron, it needs to specify the full path.
Because environment variables for cron is different from those about your user. |
Haven't tried that.Will see if that resolves my problem. What does the full path look like? Thanks!!
|
full path means you start it with a slash / and will point to the file you want to execute. For example ls is located in /bin, therefore it is /bin/ls using full path. Also man is located in /usr/bin, it will be /usr/bin/man.
So execute the command which arecord, that will show you the full path to arecord and use that in your crontab: 9 11 * * 4 /full/path/to/arecord -t wav -f cd -d 44 /home/randy/chuo-radio-shows/testaudioJUN0514.wav |
So it is the full path to arecord? That's interesting. I thought you meant full path to the .wav file which I already used. Thanks for this info!!
I will post back with my results. I learned something new. Thanks again! |
The echo command below prints your user environment path.
Code:
~ $ echo $PATH Code:
~ $ which arecord |
I suspect the full path won't help - after all, the output file wouldn't be created if it didn't run.
What I think is happening is that arecord doesn't have access to the audio source, thus getting either an EOF and exiting, or creating an error message. Audio device access isn't something that cron would enable. |
All times are GMT -5. The time now is 07:01 AM. |