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

A case of linux using crontab to add scheduled tasks

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

Share

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

This article is about Linux using crontabs to add timed tasks. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

preface

Linux systems are controlled by crond, a system service. Linux has a lot of planning work on it, so this system service is started by default.

The crontab command is used to set instructions that are executed periodically. This command reads instructions from standard input devices and stores them in a "crontab" file for later reading and execution.

We can see the status of crond service:

From this you can see that the crond service is enabled and active

In addition, because users can also set scheduled tasks themselves, Linux systems also provide user control of scheduled tasks command:crontab command.

crontab

Function: add, query, delete instructions for system scheduled tasks.

[root@localhost ~]# crontab

Options:

-e: Edit crontab timed tasks

-l: query crontab task

-r: Delete all crontab tasks for the current user 12345

[root@localhost ~]# crontab -e#Enter crontab editing interface. vim will open to edit your work #Enter data in the basic format:* ** * command12345

1. Format explanation:

Examples:

2. special format

example

3. Import and export from files to files

#import [root@localhost ~]# crontab filename#export [root@localhost ~]# crontab -l >filename1234

Examples:

Thank you for reading! About "linux use crontab add timed task case" this article is shared here, hope the above content can have some help to everyone, so that we can learn more knowledge, if you think the article is good, you can share it to let more people see it!

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