Reputation: 3475
I'm trying to figure out how I can start a job I've created which runs a loop (that's another story).
The script is;
while [1];do
sleep 1
/usr/bin/php /var/www/mis/sms/sms_daemon.php > /dev/null 2>&1
done
When I run /etc/init.d/sms_daemon start
(job I created) - it never returns back to the command prompt unless I hit ctrl-z
or ctrl-c
, which stops the service...
Upvotes: 1
Views: 101
Reputation: 399
create a function & run that in the background
start_job(){
while [1];do
sleep 1
/usr/bin/php /var/www/mis/sms/sms_daemon.php > /dev/null 2>&1
done
}
start_job &
or
nohup start_job
Upvotes: 1