First, homework (exercise) content:1. Summarize the detailed usage method of the task plan (at, crontab) on Linux system;http://xiexiaojun.blog.51cto.com/2305291/16880682, every Monday to Saturday 3:20 A.M., run the CP command to archive the/etc/directory, storage location is/BACKUPS/ETC-YYYY-MM-DD;2 * * * 1-6/bin/cp-a/etc//backups/etc-$ (date +%f) >/dev/null3, every Sunday 2:30 A.M., run the CP command to backup the/etc/fstab file, the storage location is/BACKUP/FSTAB-YYYY-MM-DD-HH-MM-SS;2 * *
root@~:~# CRONTAB-E
No crontab for root-using an empty one
888
I can't do it from the new installation.
There's no way to get into edit cron
Reply to discussion (solution)
Ubuntu System Admin on the first-line server set up a scheduled task, accidentally selected Nano, because the previous contact is Redhat series, not accustomed to use Nano, so want to reset, online check under, seemingly no.Helpless under, re-install a server test, found t
Some functions such as timing function and certain methods can be implemented by timing task scheduling framework quartz. The following provides a simple example of implementing the quartz framework of Hello World.Importorg.quartz.CronExpression;ImportOrg.quartz.CronTrigger;ImportOrg.quartz.Job;ImportOrg.quartz.JobDetail;ImportOrg.quartz.JobExecutionContext;Importorg.quartz.JobExecutionException;ImportOrg.quartz.Scheduler;Importorg.quartz.SchedulerException;Importorg.quartz.SchedulerFactory;Impo
PackageCom.pkfare.task.manage.config;ImportOrg.quartz.spi.TriggerFiredBundle;Importorg.springframework.beans.BeansException;ImportOrg.springframework.context.ApplicationContext;ImportOrg.springframework.context.ApplicationContextAware;Importorg.springframework.context.annotation.Configuration;Importorg.springframework.scheduling.quartz.SpringBeanJobFactory;Importorg.springframework.stereotype.Component, @Configuration @component Public classJobbeanjobfactoryextendsSpringbeanjobfactoryImplementsA
The command to view a timed task is: crontab-l the command to edit a timed task is: CRONTAB-E (effective immediately after editing if comments can be added at the beginning of the line with # and VI) Timed task description each action a taskEach line is divided into six sections, each separated by a space and separated by commas.Minute hour day_of_month month weekday commandUsing * in the first five fields means all points in timeminute:0-59Hour:0-23,0 stands for 0 pointsDay_of_month:1-31Month:1
Cron expressions (used in quartz.net)Consists of 7 segments: The second day of the Month and the Moon (optional)"-": The range mon-wed represents Monday to Wednesday",": The enumeration Mon,web represents Monday and Wednesday"*": Table is "per", monthly, daily, weekly, yearly etc.For the week inside, Sun=1 sat=6"/": Represents the Increment: 0/15 (in minutes) every 15 minutes, starting after 0 minutes, 3/20 every 20 minutes, starting from 3 minutes la
from 0 to 59.Hour: Represents the hour, which can be any integer from 0 to 23.Day: Represents a date, which can be any integer from 1 to 31.Month: Represents the month, which can be any integer from 1 to 12.Week: Represents the day of the week, which can be any integer from 0 to 7, where 0 or 7 represents Sunday.Command: The commands to execute can be either system commands or script files that you write yourself.10.24 Chkconfig Tools10.25 SYSTEMD Management ServicesCrond service startup will b
Tags: simple operation of Linux crontabA recurring task schedule requires a package, uninterrupted monitoring time. CentOS7 need main package: Cronie (provides crond daemon and related AIDS)Recurring task scheduling requires first ensuring that the Crond daemon is runningCrond need to use a dedicated configuration file, this file has a fixed format, it is not recommended to use a text editor to edit this file directly, to use the crontab commandSystem Cron
Release date:Updated on:
Affected Systems:Baseurl yum 3.4.3Description:--------------------------------------------------------------------------------Bugtraq id: 65119CVE (CAN) ID: CVE-2014-0022
Yum is a package manager under Fedora and RedHat linux.
In Yum 3.4.3 and earlier versions, the installUpdates function of yum-cron/yum-cron.py does not properly check the return value of the sigCheckPkg function, which allows remote attackers to pass unsig
1, the meaning of each fieldSeconds 1 Seconds (0-59)Sub 2 Minutes (0-59)3 Hours (0-23)Day 4 days of month (1-31)Monthly 5 month (1-12 or JAN-DEC)Week 6 day of week (1-7 or Sun-sat)Year 7 years (1970-2099)2. Special characters"/": "1/20" means, starting from the 1th minute, every 20“? ": Indicates a day of the month, or a day of the week"W": indicated as the most recent weekday, "15w" monthly field to the nearest working day of month 15th"#": The nth business day of the month, "6#3", means the th
There are 2 types of cron expressions:Seconds Minutes Hours dayofmonth Month DayofWeek year orSeconds Minutes Hours dayofmonth Month DayofWeekTime of day and month of moonSpecial characters allowed for field allowed valuesSeconds 0-59,-*/Sub 0-59,-*/Hours 0-23,-*/Date 1-31,-*? /L W CMonth 1-12 or JAN-DEC,-*/Week 1-7 or Sun-sat,-*? /L C #Year (optional) leave blank, 1970-2099,-*/0 0 * * *? Daily hourly executionhttp://blog.csdn.net/error_case/article/d
About the implementation of PHP cron task management
Before each development of a scheduled task function requires online operation crontab to add new items, so you want to use PHP to unify the management of task items in a single project?
You can create a table [Id,name,status,func,timer,last_time,created_at] to unify the scheduled task script in the project, through a simple configuration?
The ability to abstract each scheduled task into a simple ta
Let's see the interface!
Cron. mxml:
Extendscheckbox.:
package com.gzhdi.backup.cron{import spark.components.CheckBox;public class ExtendsCheckBox extends CheckBox{private var _value:String;public function ExtendsCheckBox(){super();}public function get value():String{return _value;}public function set value(value:String):void{_value = value;}}}
,$1 is source dir# and $ is destination dir. Dir= $/* des= $ # Test The destination dirctory whether exists[- D $des] Echo "Dir Exist"Exit 1 # Create The destination dirctoryMkdir$des # Set counter, it would auto increase to the number of# source file. I=0 # Count of the number of source fileN= 'Echo $/* |wc-w ' forFileinch`Echo $dir` Do # Calculate Progresspercent=$ (( -* (++i)/n)) Cat $percentCopying file$file... XXX Eof/bin/cp-r$file $des>/dev/null Done| Dialog--title"Copy"--g
. Dir= $/* des= $ # Test The destination dirctory whether exists[- D $des] Echo "Dir Exist"Exit 1 # Create The destination dirctoryMkdir$des # Set counter, it would auto increase to the number of# source file. I=0 # Count of the number of source fileN= 'Echo $/* |wc-w ' forFileinch`Echo $dir` Do # Calculate Progresspercent=$ (( -* (++i)/n)) Cat $percentCopying file$file... XXX Eof/bin/cp-r$file $des>/dev/null Done| Dialog--title"Copy"--gauge"Files" 6 -ClearEffect9.Echo outputFea
example: "0/15" in sub-expressions (minutes) means starting from the No. 0 minute, every 15 minutes"3/20" in the sub-expression (minutes) means that every 20 minutes (it is the same as "3,23,43") starting from the 3rd minute“? "Character is used only for days (months) and days (weeks) of two sub-expressions, indicating that no value is specifiedWhen one of the 2 sub-expressions is assigned a value, in order to avoid a conflict, you need to set the value of another subexpression to "? ”The "L" c
written crontab is then executed every minute, as follows:
Copy Code code as follows:
Crontab-e
* * * * */bin/bash/home/somedir/cron-seconds.sh * * *
The third method:
So how do you use a scheduled task to implement it directly?The final solution is as follows, and it is validated that the script runs very stably.
Copy Code code as follows:
Crontab-e
# # for Excuting scripts.sh every 3 seconds# #on 2014-10-15
This example describes the PHP version of the Cron Timer task executor usage, which is a very useful functional application. The specific methods are as follows:
Since the server crontab can only be accurate to minutes, the starting point of the program is also minutes.
This feature consists of three parts altogether:
First, the configuration file:
The configuration file is used to return the scheduled task file to be executed, note the use of the
The previous two is a simple trigger (Simpletrigger), Simpletrigger can only handle simple events, if you want to be flexible to trigger the task, you need to
Crontrigger this important person.
Crontrigger is also one of the most important features of quartz, by quartz specific cron expression to determine a certain kind of time, can complete similar "November 11, 2011 (God Stick Day, has passed), each Wednesday xxx" complex timing tasks.
Code or old
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.