Hi All
I want to restart a program at midnight every night.
Rebooting the Beaglebone black is not an option as even though it is battery backed, it loses date/time when rebooting.
So I investigated a script method , but because I am using Xorg without a window manager, Xorg terminates when my program exits.
Then tried using the return value of the program to restart it, but it got more & more complicated.
Found on searching on the forum a post by fxm, that used shell to start another program (fxm used notepad) and then quitting the original program after a sleep worked. In my case I simply restarted the same program.
My question:
What are the implications of doing this every day for months on end ?
Am I going to eat up memory and eventually crash ?
I guess I can read memory available but not sure how reliable that reading is, as other activity could corrupt that info.
Regards
Restarting same program numerous times with Shell.
Re: Restarting same program numerous times with Shell.
Fine, no problem but: NOT with Shell.Dinosaur wrote:I want to restart a program at midnight every night.
Use a second program, started from first before exit, to restart the original.
This is a tried and tested method, used in industrial environment by my application.
I've called mine simply: reStart, it terminates itself after launching original again.
Is running for about +10 years, by now (automotive industries).
This should also answer the additional questions you've listed.
Re: Restarting same program numerous times with Shell.
Hi All
Thanks for the reply MrSwiss.
I haven't used "Run" command since my QBasic days, so it wasn't even on my radar.
So the solution was to simply check for a serial time less then 2 sec's (was worried about repeated reStarts) and:shows bytes of free memory stable for at least 10 tries.
Regards
Thanks for the reply MrSwiss.
I haven't used "Run" command since my QBasic days, so it wasn't even on my radar.
So the solution was to simply check for a serial time less then 2 sec's (was worried about repeated reStarts) and:
Code: Select all
Shell "free -b"
Regards
Re: Restarting same program numerous times with Shell.
EitherDinosaur wrote:My question:
What are the implications of doing this every day for months on end ?
Am I going to eat up memory and eventually crash ?
I guess I can read memory available but not sure how reliable that reading is, as other activity could corrupt that info.
- SLEEP your program until next day (do not exit, but run it as a daemon=background process), or
- define a cron job in the operating system