shell - Is there a way to run a program and kill every 20 seconds in linux? -
i have program need collect 300 pieces of data from, manually collecting have run program on ubuntu virtual machine , record data on excel. takes long time whole process. wondering if there command in linux use call commands make , kill me program. search watch , tried doesnt work me:
watch -n 20 make play
where make play runs program
yet doesnt fo want do. want every 20 seconds have enough time write data excel file 1. make play (run program prints need record) 2. kill program
is there command this?
i think should rethink doing - can't think of setting running , killing program every 20 seconds makes sense.
that being said, standard way run programs periodically in linux cron job. cron has 1 minute minimum though, have write script starts 3 instances of program 20 second delay, , run script cron every minute. can combine timeout utility, kill program if still running after given time. quick google search should provide further details.
Comments
Post a Comment