Ok so I have a cron that I need to run every 30 seconds.
Here is what I have:
*/30 * * * * /bin/bash -l -c \'cd /srv/last_song/releases/2012030813315
You can run that script as a service, restart every 30 seconds
Register a service
sudo vim /etc/systemd/system/YOUR_SERVICE_NAME.service
Paste in the command below
Description=GIVE_YOUR_SERVICE_A_DESCRIPTION
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=simple
ExecStart=YOUR_COMMAND_HERE
Restart=always
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
Reload services
sudo systemctl daemon-reload
Enable the service
sudo systemctl enable YOUR_SERVICE_NAME
Start the service
sudo systemctl start YOUR_SERVICE_NAME
Check the status of your service
systemctl status YOUR_SERVICE_NAME