mysql - How to queue a shell command if [conditon] is not fulfilled? -
I am uploading data from a shell script (from cron) to MySQL database every 5 minutes. But if my connection stops, he does not include it in his database.
I would like to try to insert the script repeatedly (for example every 30 minutes) until it is not successful.
And if my connection is less than 5 minutes, then I want to stand in line for these requests and move on as I move forward.
How can I do this? Example code:
#! / Bin / bash cputemp = $ (some commands ...) / usr / bin / mysql -h 127.0.0.1 -U administrator-pipepassword -e "usi logs; cputemp values INSERT ('$ cputemp'); "
You should know it by writing it in that code in your logic It can detect, sleep it, try again.
Comments
Post a Comment