I wrote a simple script to grab an audio stream and save it into a file.
I need to run this file 5 days a week, the process should record the
stream for ~ 2 hours. What is the best way to approach this problem?
I’m thinking of starting the process with a cron job, on a FreeBSD
server, but then what is the best way to control the process based on
time?
I wrote a simple script to grab an audio stream and save it into a file. I
need to run this file 5 days a week, the process should record the stream
for ~ 2 hours. What is the best way to approach this problem?
I’m thinking of starting the process with a cron job, on a FreeBSD server,
but then what is the best way to control the process based on time?
I’m sure there may be fancier ways - but a pid file and another cron
task 2
hours later that kills the pid is as simple and as clean as you can get.
I
do this exact thing myself and it works like a charm.
I’m thinking of starting the process with a cron job, on a FreeBSD
server, but then what is the best way to control the process based
on time?
There is a class called Timeout: “provides a way to auto-terminate a
potentially long-running operation if it hasn’t finished in a fixed
amount of time.”
Carlo
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.