Cron job

Status
Not open for further replies.

vespaman

Member
Jul 28, 2017
49
2
8
Greetings,

I have a cloud FPBX server:
Debian 9.9
4.5.8
1.8.4 (64bit)

I would like a cron job to restart the freeswitch service once a week on sunday but am unsure of the correct syntax.

00**0 service freeswitch restart

would this be OK ?
 

vespaman

Member
Jul 28, 2017
49
2
8
OK, thanks for the help, I changed the job to run on a saturday and did this:

root@sip:~# crontab -e

0 0 * * 6 @weekly systemctl restart freeswitch

no crontab for root - using an empty one
crontab: installing new crontab

when I go back into crontab -e I see the command there so will wait till the weekend to see if it works.
 

EasyBB

Active Member
Oct 23, 2016
240
33
28
Australia
0 0 * * 6 @weekly systemctl restart freeswitch

You can use either formats below:

Code:
@weekly systemctl restart freeswitch

OR

Code:
0 0 * * 0 systemctl restart freeswitch

Also please note, sometimes you may need to use full path to systemctl, like /usr/bin/systemctl
 
Last edited:

vespaman

Member
Jul 28, 2017
49
2
8
OK thanks for the help.
I Have changed the syntax and will wait to see if it works.
 
Status
Not open for further replies.