I'm looking for a method to start an application immediately after boot-up. This application times out after 1 hour. I'd like to then start another instance of this application 1 hour after the initial boot-up (following the timeout of the initial application). I had been thinking that Cron might be configured (cleverly) to accomplish this. Short of resetting the system clock to 00:00:00 at boot-up and then running Cron normally, is there a way to do this? Thanks in advance.
Update: Based on maulinglawn's advice I have gone with the Systemd.service method. Specifically, I've put a copy of my python script in /usr/bin/startVideo/startVideo.py. Then created a service file in /lib/systemd/service/startVideo.service. Here's that file,
[Unit] Description=starts video recorder [Service] Type=simple ExecStart=/usr/local/bin/startVideo/startVideo.py Restart=always [Install] WantedBy=multi-user.target
Finally I ran,
sudo systemctl enable startVideo.service
to register the service. This will be running on a Raspberry Pi3 wired to a video camera with no monitor or keyboard attached. I'm just looking for the system to record video 24/7 and have the capability to restart itself in the event of a power failure. Other suggestions? Is "WantedBy" configured correctly for this type of application?
Massively grateful for this solution and steerage away from Cron-ville.