Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure cron Service under windows platform

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What this article shares with you is about how to configure cron service under the windows platform. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

Under the windows platform, if you want to manage a similar linux management interface, our commonly used tool is cygwin, which can be customized and installed according to your own needs, such as sshd,cron and other services. Here is a record of the problems encountered after the rod-shaped cron package and how to deal with them.

Scene:

Due to the remote backup via ssh, I installed the corresponding packages of cygwin and sshd/cron. After installation, I worked out the backup script and backup task, but found that the scheduled task was not carried out at the specified time. The first thing that comes to mind must be whether the cron service is not started. After checking, it is found that only installing the cron package is not enough. You need to configure the cron service under windows (like sshd). After configuring the service, it is found that it still cannot be started.

Error message:

09:38:58 on 2017-05-12 [SYSTEM] cron: PID 3588: Possible duplicate cygwin1.dll: / cygdrive/c/Program Files (x86) / ICW/bin/cygwin1.dll.

09:38:58 on 2017-05-12 [SYSTEM] / cygdrive/c/cygwin/usr/sbin/cron: PID 3400: (CRON) DEATH (can't open or create / var/run/cron.pid: No such file or directory)

09:38:59 on 2017-05-12 [SYSTEM] cron: PID 3004: `cron' service stopped, exit status: 1

Detailed processing steps:

1. Configure cron service

Cygrunsrv-I cron-p / usr/sbin/cron-a-n

2. Start the cron service

Cygrunsrv-S cron

3. View the startup log

/ usr/bin/cronevents.exe

09:38:58 on 2017-05-12 [SYSTEM] cron: PID 3588: Possible duplicate cygwin1.dll: / cygdrive/c/Program Files (x86) / ICW/bin/cygwin1.dll.

09:38:58 on 2017-05-12 [SYSTEM] / cygdrive/c/cygwin/usr/sbin/cron: PID 3400: (CRON) DEATH (can't open or create / var/run/cron.pid: No such file or directory)

09:38:59 on 2017-05-12 [SYSTEM] cron: PID 3004: `cron' service stopped, exit status: 1

(due to the cygwin1.dll conflict of the installation software, it needs to be removed temporarily)

4. Rename / cygdrive/c/Program Files (x86) / ICW/bin/cygwin1.dll

Mv / cygdrive/c/'Program Files (x86)'/ ICW/bin/cygwin1.dll / cygdrive/c/'Program Files (x86)'/ ICW/bin/cygwin1.dll_bak

5. Start the Cron service again

Cygrunsrv-S cron

Normal start

09:45:35 on 2017-05-12 [SYSTEM] / usr/sbin/cron: PID 3260: (CRON) STARTUP (v5.0)

09:45:36 on 2017-05-12 [SYSTEM] cron: PID 4008: `cron' service started

6. Knowledge expansion-cygrunsrv parameter description:

-I: installation service

-R: delete service

-S: start the service

-E: stop service

-Q: query service

-L: show all services

Parameters for the installation service:

-p: specify the server path

-a: specify service program command parameters

-e: specify the environment variable of the service program

-d: display name of the service

The above is how to configure cron services under the windows platform. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report