PHP use cron to achieve the article synchronization to Sina, NetEase and other micro-bo
1.tw2other
?
A PHP applet that supports Twitter sync to digu/sina/zuosa/follow5/9911/watercress Radio/fresh fruit hookup/Human Network/Renren/NetEase Weibo
?
Author: cluriesAuthor's homepage: http://cuies.com
Tw2other Download Address: http://code.google.com/p/tw2ohter/? or download from the attachment (not guaranteed the latest version)
?
Settings are as follows
When using the timer quartz, the cron expression, the boss said that as a development you can read, other non-development colleagues may not understand, to use a way they can understand the expression.Fortunately our project requires an expression that is not particularly troublesome, so we have written a simplified method of converting to ChinesePackage Com.common.utils;import Java.text.parseexception;import Java.text.simpledateformat;import Java.uti
CronCron is a tool name that executes the script you specify according to a certain time policy, just as it does with timed tasks under Windows.Its corresponding daemon is Crond, which is started as a service at boot time.Therefore, Cron can be managed using service management commands, such as Service,chkconfig.For specific use, refer to:http://blog.csdn.net/jx_jy/article/details/13289217Configuration fileThe crond process wakes up once every minute,
PHP use cron to achieve the article synchronization to Sina, NetEase and other micro-bo
1.tw2other
?
A PHP applet that supports Twitter sync to digu/sina/zuosa/follow5/9911/watercress Radio/fresh fruit hookup/Human Network/Renren/NetEase Weibo
?
Author: cluriesAuthor's homepage: http://cuies.com
Tw2other Download Address: http://code.google.com/p/tw2ohter/? or download from the attachment (not guaranteed the latest version)
?
Settings are as follows
There is a command in Linux that can perform system tasks on a regular basis. This is the Crond service. The following is an introduction to the use of the crontab command.
Linux task scheduling is mainly divided into the following two categories:
Edit/etc/crontab File Configuration cron
The cron service does not only have to read all the files in the/var/spool/cron
Delay Task at
1.at commandHow to use:
At now+5min| time
> Command
>ctrl + D
Example:
At 14:20
at> date
at>
At Now+5min
at> date
at>
At- L | ATQ # #查看未执行的延时任务
atrm IP | At- D # #终止延时任务
at-M # #延时任务有输出不产生邮件, exit message using Q
At- c IP # #查看延迟任务的内容
at-M # #延时任务无输出产生邮件 Mail # #查看邮件的内容, mail in/var/spool/mail/kiosk
At- f filename # #将文件内容中的命令作为延时任务的动作
2. Blacklist/etc/at.deny # #at命令黑名单配置文
contents of a task[[email protected] tmp]# at-c 5 here omit N bytes/etc/init.d/mysqld start #倒数第二行, is the command to executeRecurring Task Scheduler: CronBefore you use Cron to make scheduled tasks, make sure that the Crond service is started and that the Crond service is set up to enable active startupEnsure that the Crond Daemon (daemon) is in a running state:CentOS 7:systemctl Status Crond.serviceactive:active (running) ...CentOS 6:Service Crond
/sbin/service Crond Start//Startup service/sbin/service Crond stop//Shut down service/sbin/service crond Restart//Restart service/sbin/service Crond Reload//Reload ConfigurationYou can also start the service automatically when the system starts:At the end of the/etc/rc.d/rc.local script, add:/sbin/service Crond Start
Crontab-u//Set a user's Cron service, which is usually required by the root user when executing this commandCRONTAB-L//list det
A cron expression has at least 6 (or possibly 7) time elements that have a space separation.sequentially seconds (0~59)Minutes (0~59)Hours (0~23)Days (months) (0~31, but you need to consider the number of days of your month)Month (0~11)Days (weeks) (1~7 1=sun or Sun,mon,tue,wed,thu,fri,sat)7. Year (1970-2099)Each of these elements can be a value (such as 6), a continuous interval (9-12), a time interval (8-18/4) (/= every 4 hours), a list (1,3,5), and
Recently, the internship wrote a small timing statistics program, with spring @Scheduled annotations, the note relies on the following jar package
Before using this annotation, please do the following to prepare and configure the appropriate XM file.
To configure timed annotations: http://blog.csdn.net/sd4000784/article/details/7745947
The meanings of each parameter in the cron parameter are given below:
Cron
In ubuntu, the scheduled execution tool cron is enabled, and the restart configuration file is usually/etc/init. d/cron start: sudo/etc/init. d/cronstart close: sudo/etc/init. d/cronstop restart: sudo/etc/init. d/cronrestart re-load configuration: sudo/etc... in ubuntu, the scheduled execution tool cron is enabled, and the restart configuration file is usually/et
: Self is a service that runs uninterruptedAnacron:cron, can be implemented to enable cron for various reasons in the past time the execution of the task did not perform the normal execution once;cron configuration file:/etc/crontab[Email protected] ~]# Cat/etc/crontabShell=/bin/bash #定义执行脚本的shell为/bin/bashPath=/sbin:/bin:/usr/sbin:/usr/bin #定义脚本执行的环境变量位置Mailto=root #执行结果发送给root用户home=/ #家目录# Run-parts: ind
linux PHP to implement a cron task on a timed basis There is no solution for PHP itself to perform timed tasks, but with the sleep function. This side is to do some early configuration, such as the implementation of the process: nbsp; nbsp; Code as follows: Ignore_user_abort ()//Turn off the browser, PHP script can continue to execute. nbsp; nbsp; Set_time_limit (0);//Through Set_time_limit (0) can let the program unrestricted execution down nbsp; n
For PHP itself there is no set of solutions to perform timed tasks, but it is done with the sleep function. Such a party is to do some configuration in advance, such as the implementation process:Ignore_user_abort();//turn off the browser and the PHP script will continue to execute. Set_time_limit(0);//set_time_limit (0) allows the program to be implemented without restrictions $interval=60*30;//running every half hour Do{ //Here is the code you want to execute Sleep($int
Task Schedule:1, at some point in the future to perform a task at a time;At specified time executionBatch idle time executionAt timeAt>commandAt>ctrl+dSpecify time:Absolute time: hh:mm, DD. Mm. YY Mm/dd/yyRelative Time: now+#Units: Minutes,hours, days, weeksBlur Time: Noon, midnight, teatimeExecution result of the command: sent to the user who scheduled the task in the form of a message[Email protected] tmp]# at Now+1minAt> ls/tmpat> # Press CTL + DJob 2 at 2016-12-02 17:17[Email protected] tmp]
Sbinservicecrondstart start service sbinservicecrondstop disable service sbinservicecrondrestart restart service sbinservic
/Sbin/service crond start // start the service
/Sbin/service crond stop // close the service
/Sbin/service crond restart // restart the service
/Sbin/service crond reload // reload the configuration
This service can be automatically started when the system is started:
Add:
/Sbin/service crond start
1. directly use the crontab command to edit
The
/CC/wKioL1WI4i-zsaGmAAEzPR3KpOs488.jpg "title=" 2015-06-22_10-53-55.png "alt=" Wkiol1wi4i-zsagmaaezpr3kpos488.jpg "/>
Batch: Using the same method as at, background tasks are performed only when the CPU load is less than 0.8
Cron: cyclic execution of routine work scheduling1: Workflow
crontab command to generate the work to run
Writes work as text to the /var/spool/cron dir
I am not interested in Java on Gae. What I pay the most attention to in this upgrade is that gae finally has cron. feedzshare needs to regularly capture the feed, and can only find another machine to regularly access feedzshare for activation without cron. cron has always been my most desired feature. find the document and download the latest SDK (remember to go
This time talk about "cron"."cron" is the "tool for automating tasks on a regular basis" (equivalent to a scheduled task in Windows). Read "Sloan". With "cron", you can pre-specify that a task executes at a certain time.The designation of time is not just a simple "one-hour" method, you can specify that only one day to perform a task, or specify a 8-point ~22 poi
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.