search
Homephp教程PHP开发Linux crontab scheduled tasks

What is crontab?

The crontab command is the abbreviation of cron table. It is the configuration file of cron, also called the task list. We can find the relevant configuration files in the following directory

/var/spool/cron/: stores all user definitions to be executed regularly The task, the file name is consistent with the user name
/etc/crontab: Tasks to be performed periodically by the system
/etc/cron.d/: Directory used to store any crontab files or scripts to be executed
Other directories: /etc/ cron.hourly, /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly, each represents the storage of tasks executed hourly, daily, weekly, and monthly

Usage of crontab

crontab [-u username]     //可选,省略则表示操作当前用户的crontab
        -e        //编辑crontab定时任务
        -l        //列出crontab里的内容
        -r        //删除crontab

crontab commands are composed of time and commands. The time is arranged in order by minutes, hours, days, months, and Fridays. The operators are:

*: any time
/:How often
-:Continuous time
,:Discontinuous time

Instance description

Execute the command every minute

* * * * * The command

is executed at the 10th and 30th minutes of every hour

10,30 * * * * Command

is executed every minute from 8 to 10 o'clock

* 8-10 * * * Command

is executed every 10 minutes on the 15th of every month

*/10 * 15 * * Order

is executed every Monday at 6:30

30 6 * * 1 Order


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software