We have to restart the iSymphonyServerV3 service about once every 2 weeks. We contacted cloud9 and they did an update which made it a lot better, but it is still an issue where we have to restart. How can I create a crontab to set it to restart once a week or night?
Let’s say you want to have a cron that restarts iSymphony every Sunday at 1:30 am or something like that.
crontab -e
then add to the file
30 1 * * 0 /bin/systemctl restart iSymphonyServerV3
This is adjustable based on when and how often you want to restart the service.
Perfect. I’ll give this a shot. Sometimes, I have to wait like 60 sec before I start it. How could we schedule the stop, then start 60 seconds later?
You can write a script to do a systemctl stop iSymphonyServerV3
and then wait and run the start command, then point your cron to that script instead but why would you have to wait? The restart command will not start until it completely stops first.
sometimes it takes a min to stop but I’ll try the restart first
The restart should definitely wait for the stop to complete before it tries the start. If you have any issues, create a bash script like below:
#!/bin/bash
/bin/systemctl stop iSymphonyServerV3
sleep 60
/bin/systemctl start iSymphonyServerV3
Then make your crontab like
30 1 * * 0 /path/to/file.sh
Make sure the file is executable.
Thanks again!
so I tried this and it doesn’t appear the crontab restart is working. Running systemctl status iSymphonyServerV3 gives Active: active (running) since Wed 2021-06-23 19:22:23 EDT; 2 days ago
cron jobs run in the /bin/sh environment by default ($PATH and all) , make sure your script so honors that, you should edit as
crontab -e -u root
and make sure it works after you
su root
(run the script as in the crontab)
The script runs. I ran the crontab as admin, so I’ll see what it does tonight. Thanks as usual Dicko
If you actually have an ‘admin’ account with sufficient privileges it should work
still no luck. The crontab is not running. Manually running the command works fine.
What is the output of crontab -l
0 0 * * * ~/scripts/archive.sh
30 1 * * 0 /bin/systemctl restart iSymphonyServerV3
Keep in mind that this will only run this cron at 1:30 am on Sundays. Check /var/log/cron
and find the line for that specific cron at that time and paste it here.
I’ll check next week then lol and post back
You can change it to run on a different day if you don’t want to wait. That last 0
is Sunday. 0 thru 6 = Sunday thru Saturday.
Once a week should be fine. This program has had memory leaks since day one. Talked to the owner. It’s gotten better and a great program but this is the easiest fix lol without adding a ton of ram
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.