In AnQiCMS scheduling task, how to correctly delete the `start.sh` task that is no longer needed?

Calendar 👁️ 73

As an experienced website operations expert, I fully understand the importance of each system task configuration and maintenance for the stable operation of the website.AnQiCMS (AnQiCMS) is highly praised in the content management field for its efficiency and convenience.In daily operations, we sometimes encounter situations where we need to adjust or remove specific tasks, such as those that are no longer neededstart.shPlan tasks. Properly handle these tasks not only concerns the efficient use of server resources, but also related to the overall cleanliness and safety of the system.

Today, let's delve into the details of how to correctly and safely remove the task scheduler that protects your AnQiCMS instance when you decide not to letstart.shit guard your AnQiCMS instance, how to correctly and safely remove it from the system.

Understandingstart.shThe responsibility of the task

In the command line deployment scenario of AnQiCMS,start.shThe script plays the role of a 'guardian god'. It is usually configured as a scheduled task for the Linux system (crontabIts core purpose is to periodically check if the AnQiCMS main program is running. Once it detects that the program has stopped unexpectedly,start.shIt will restart immediately to ensure the continuous online operation of the website service, greatly enhancing the stability of the system.

Therefore, when you plan to delete this task, you are telling the system: I no longer need you to automatically monitor and restart my AnQiCMS application.This usually happens after you decide to manually manage the application lifecycle or migrate AnQiCMS to other management modes (such as Docker containers).

Remove properlystart.shPlan the steps of the task

To deletestart.shTask, we need to directly operate the Linux system's scheduled task configuration. This process requires careful attention to avoid unnecessary impact on the server due to incorrect operations.

First, connect to your Linux server via SSH. Once logged in, you need to open the current user's task scheduler configuration file. Enter the following command in the terminal:

crontab -e

Execute this command and the system will open a text editor (usually Vim or Nano), displaying all the scheduled tasks configured by the current user.

In the open editor, you will see entries similar to the following format, which include yourstart.shtask:

*/1 * * * * /www/wwwroot/anqicms.com/start.sh

This line of configuration means, execute the location located every minute/www/wwwroot/anqicms.com/Under the directorystart.shScript. Please carefully check the path to find the AnQiCMS instance you want to delete corresponding tostart.shTask entry.

After finding the target line, you can choose two ways to handle:

  1. Completely delete:Delete this line directly.
  2. Comment out (recommended, safer):Add a symbol at the beginning of the line.#For example:
    
    # */1 * * * * /www/wwwroot/anqicms.com/start.sh
    
    The benefit of commenting out a task is that if you need to restore this task in the future, you just need to remove#the symbol, without having to re-enter the entire command.

After making changes, save the file and exit the editor. In Vim editor, you can pressEsckey, then enter:wqand sort byEnterto save and exit. If it is a Nano editor, it is usually pressedCtrl+X, then enterYConfirm save and finally pressEnter. The system will promptcrontab: installing new crontabor similar information, indicating that your changes have taken effect.

Don't forget to stop the AnQiCMS process that is running.

Delete only.crontabentries, will only prevent the system from automatically restarting in the future.start.shThe script will not immediately terminate the AnQiCMS main program that may be running currently.In order to completely remove unnecessary tasks and release resources, you also need to manually stop the AnQiCMS running instance.

If you are instart.shThe script is located in the same directorystop.shThe script (such as mentioned in the AnQiCMS installation document), you can directly execute it to stop the program:

/www/wwwroot/anqicms.com/stop.sh

Please replace the path with the actual installation directory of your AnQiCMS.

Ifstop.shThe script does not exist, or the program still runs after execution, then you need to manually find and terminate the AnQiCMS process.You can find the process ID (PID) by listening to the port used by AnQiCMS.Assuming your AnQiCMS uses the default8001You can use the following command to specify the port:

lsof -i:8001

After executing, you will see an output similar to the following, among whichPIDThe column is the process ID of the program:

COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
anqicms  7621   www    3u  IPv6  49826      0t0  TCP *:8001 (LISTEN)

In this example, the PID of AnQiCMS is7621. After obtaining the PID, you can usekill -9command to forcibly terminate the process:

kill -9 7621

Please replace7621Replace it with the actual PID you find. After performing this operation, the AnQiCMS program will be forcibly closed.

Special considerations for multi-site deployment with Docker

The above throughcrontab -eManagestart.shThe method of the task, mainly applicable to the deployment of AnQiCMS instances directly on Linux servers through the command line.

If you have installed and managed AnQiCMS through the Go project feature of Baota panel, the Docker application of 1Panel, or the Docker one-click deployment of aaPanel, then the process management method will be different:

  • Bao塔Go project:Generally, the "Website" -> "Go Project" interface of the Baota panel is used for management, tasks such as starting, stopping, and deleting are completed on the panel, and manual modification is not requiredcrontab.
  • Docker deployment (1Panel, aaPanel):In the Docker environment, the lifecycle of the application is managed by the Docker container itself, usually through the container'srestart_policy(Restart policy) or use the stop/delete container function provided by the management panel to achieve this. In this case, the servercrontabusually will not havestart.shtask entries, so you do not need to perform the abovecrontabOperation. To delete, simply delete or stop the container through the corresponding management panel.

Summary

Correctly delete the unnecessary content in AnQiCMS.start.shScheduling tasks are a critical link in ensuring that server resources are effectively managed and potential conflicts are avoided. It is through careful modificationcrontabManually stop the running process, you can clearly control your AnQiCMS deployment environment.For users deploying based on Docker or other panels, they should follow the management specifications of the respective platform.


Frequently Asked Questions (FAQ)

Q1: I deletedcrontabofstart.shEntry, but why is the AnQiCMS website still running?A1:crontabEntry is only responsible for starting the scheduling task. It will not stop the already running program. When you deletecrontabAfter the entry, the system will no longer automatically check and restart AnQiCMS, but if the program has run successfully before that, it will continue to be online. Therefore, you need to perform an additional stop operation, such as runningstop.shScript, or manually search for and terminate the AnQiCMS process (using)lsof -i:{端口号}Find the PID, then usekill -9 {PID}Terminate).

Q2: If I forgetstart.shWhat is the specific path of the script, and what methods can quickly find it?A2: If you rememberstart.shthe approximate file name, you cancrontab -eCommand to open the scheduled task file, usually you can find the file that containsstart.shthe complete path. In addition, you can also try to usefind / -name "start.sh"(It may take a long time) or look for it in the installation directory of your AnQiCMS.For Go projects deployed on the Baota panel, you can directly view the execution file path on the Go project management page of the panel.

Q3: I am deployed via Docker container for AnQiCMS, do I also need to delete according to these steps?start.shTask?A3: Generally not required. When deploying AnQiCMS with Docker, container lifecycle management is typically handled by the Docker engine or the panel you are using (such as 1Panel, aaPanel).start.shThis script is typically used to run the AnQiCMS binary file directly on the host machine and perform monitoring. In the Docker environment, you should manage the AnQiCMS instance by stopping or deleting the corresponding Docker container, rather than manually modifying the host machine'scrontabfile.

Related articles

How to check `crontab` configuration and 'Save and Exit' when AnQiCMS back end is inaccessible?

AnQi CMS is an efficient and customizable enterprise-level content management system, whose stable operation is crucial for website operation.When you suddenly find that the AnQiCMS backend is inaccessible, that anxious feeling is something we operators are all too familiar with.Among many possible reasons, incorrect `crontab` configuration or operation errors during editing are often overlooked yet crucial points.Today, let's delve into how to systematically investigate this issue and master the correct posture for 'save and exit' in `crontab`.

2025-11-06

What is the role of the `nohup` command in the `start.sh` script for the continuous operation of AnQiCMS?

As an experienced website operations expert, I fully understand the importance of a stable and reliable content management system for a corporate website.AnQiCMS (AnQi CMS) leverages the efficiency and concise architecture of the Go language to provide an excellent content management experience for many enterprises.However, even the most powerful system also needs correct deployment and maintenance to ensure its continuous and efficient operation.Today, let's delve into the seemingly insignificant `nohup` command in the `start.sh` script, and explore its crucial role.

2025-11-06

How to manage the startup of different instances of `crontab` when deploying AnQiCMS across multiple sites?

AnQiCMS with its efficient and flexible architecture provides powerful support for enterprise content management.Especially when dealing with multi-site requirements, AnQiCMS provides various deployment solutions, one of which is to run multiple independent AnQiCMS instances on the same server to manage different websites.How can website operators skillfully use `crontab` scheduled tasks to ensure the stable startup and continuous operation of these different instances when adopting this deployment mode, which has become a key link that needs to be deeply understood by website operators.This article will elaborate on this topic in detail

2025-11-06

If AnQiCMS `crontab -e` opens another editor, how to 'save and exit'?

As an experienced website operations expert, I am well aware of the importance of efficient and stable system operation for AnQiCMS and other enterprise-level content management systems.When deploying and maintaining AnQiCMS, we often encounter scenarios where we need to configure scheduled tasks (crontab), such as the `start.sh` script mentioned in the `install.md` that is used to guard the AnQiCMS process.However, when executing the `crontab -e` command, many users may find that the editor opened is not the one they are familiar with

2025-11-06

What is the meaning and modification suggestion of `*/1 * * * *` in the AnQiCMS `crontab` configuration?

As an experienced website operations expert, I am happy to give you a detailed explanation of the meaning and modification suggestions of the `crontab` configuration `*/1 * * * *` in AnQiCMS.An enterprise CMS with its high efficiency, stability, and easy scalability has won the favor of many small and medium-sized enterprises and content operators. The automated mechanisms behind it, such as scheduled tasks (`crontab`), are one of the key factors for its stable operation.

2025-11-06

How to avoid accidental exit during AnQiCMS `crontab` editing, leading to configuration loss?

As an experienced website operations expert, we know that a reliable automation mechanism is indispensable for the stable operation of a website.In the world of AnQiCMS, `crontab` (scheduled task) plays a key role in starting services and executing periodic tasks.However, in practice, many operators have faced such a predicament: when editing `crontab`, due to accidental logout or improper operation, the valuable task configuration is lost instantly.This may disrupt the normal business process and bring additional troubleshooting and recovery costs. Today

2025-11-06

What is the role and modification scenario of the `BINNAME` variable in AnQiCMS `start.sh`?

As an experienced website operations expert, I know that every system configuration detail may affect the stability and operation efficiency of the website.Today, let's delve into a variable in AnQiCMS that seems trivial but plays a crucial role in actual deployment and multi-site management - the `BINNAME` in the `start.sh` script.Understand its role and modification scenarios, which can help us manage AnQiCMS sites more efficiently and safely.### Reveal the contents of AnQiCMS `start.sh`

2025-11-06

Where should `crontab` be checked first if AnQiCMS frequently restarts or stops abnormally?

AnQiCMS is an efficient and lightweight content management system, and its stable operation is the foundation of website operation.However, during use, you may occasionally encounter situations where the system frequently restarts or stops abnormally, which undoubtedly poses a great challenge to the availability of the website.When such a problem arises, you may feel some anxiety, not knowing where to start.As the 'watchman' of the website, the `crontab` (schedule task) is often the first place we need to examine, because it is responsible for the continuous operation and monitoring of the AnQiCMS core process. AnQiCMS

2025-11-06