aaP_kienvictory
If your project is set up via WebSite -> Node Project
, and you have the API enabled under Settings -> Panel Settings
.
Ensuring the apiToken
and other parameters (PanelUrl
, portPanel
, ProjectName
) are correctly entered in the restart.sh
script, then yes, you can easily set up a cron job.
1. Setting Script Permissions:
- Before proceeding to schedule the cron job, it's essential to set the correct permissions for your script.
- Go to the
Files
tab, navigate to the script path (for example, (/www/wwwroot/mySite)
), right-click on the script, and select Permission
.
- In the
Permission
field, enter 744
and click Ok
.
2. Scheduling the Cron Job:
Navigate to the Cron
tab.
In the Add Cron Job
section, select the following:
Type of Task
-> Shell Script
Name of Task
-> Any name of your choice for your task
Execution cycle
-> As per your requirement
Script content
-> Path to your script, for example, (/www/wwwroot/mySite/restart.sh)
Click on Add Task
, the task will be created.
Verify the settings, and manually activate cron. In the Task List
table, under the Task Name
column, locate the name of your task. Find the Action
header, click on Execute
, and then click on Log
. Your log should display something like this:
{
"status": true,
"status_code": 1,
"error_msg": "",
"data": "Successful restart"
}
----------------------------------------------------------------------------
★[2023-10-07 09:39:58] Successful
----------------------------------------------------------------------------
This log entry confirms a successful execution of your cron job, indicating a successful restart of your project.