- 每周
备份wordpress 数据库
备份 shfuture 数据库
以上都是 mysql 5.1 版本
For all the girls I loved
https://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontrigger.html
以下是一个可以运行的例子 ,come from
https://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/using-quartz.html
但是, 在原来的基础上, 需要做修改 ,最终代码为
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Quartz; using Quartz.Impl; using Quartz.Core; using System.Collections.Specialized; using System.Threading; using System.Threading.Tasks; namespace crontriggercS { public class HelloJob : IJob { public Task Execute(IJobExecutionContext context) { Console.WriteLine("HelloJob is executing."); return null; } } class Program { static void Main(string[] args) { // construct a scheduler factory ISchedulerFactory schedFact = new StdSchedulerFactory(); // get a scheduler IScheduler sched = schedFact.GetScheduler().GetAwaiter().GetResult(); sched.Start(); // define the job and tie it to our HelloJob class IJobDetail job = JobBuilder.Create<HelloJob>() .WithIdentity("myJob", "group1") .Build(); // Trigger the job to run now, and then every 40 seconds ITrigger trigger = TriggerBuilder.Create() .WithIdentity("myTrigger", "group1") .StartNow() .WithSimpleSchedule(x => x .WithIntervalInSeconds(10) .RepeatForever()) .Build(); sched.ScheduleJob(job, trigger); Console.ReadLine(); } } } |
修改了这句 :
1 |
IScheduler sched = schedFact.GetScheduler().GetAwaiter().GetResult(); |
原来的版本是 :
1 |
IScheduler sched = schedFact.GetScheduler(); |
编译不通过
此外, job 的返回值也要改为 Task
job datamap 用来传递 给job的参数
Cron-Expressions are used to configure instances of CronTrigger. Cron-Expressions are strings that are actually made up of seven sub-expressions, that describe individual details of the schedule. These sub-expression are separated with white-space, and represent:
a) 每三分钟
1 |
0 */3 * * * ? |
b) 非周末的每2小时 (hour 1,3,5…), 从凌晨1点开始
1 |
0 0 1/2 ? * MON,TUE,WED,THU,FRI |
c) 所有天的每2小时
1 |
0 0 1/2 ? * ? |
e) 周末的每2小时
1 |
0 0 1/2 ? * SAT,SUN |
测速 ,测网络连接
windows 去这里下载 :
1 |
https://iperf.fr/iperf-doc.php |
centos 7 :
1 |
sudo yum install iperf3 |
centos 6 32bit
How to know centos is 32 bit or 64 bit
1 |
uname -m |
在 centos 6 的安装步骤是 :
先安装 epel-release repository
1 |
sudo rpm -e epel-release |
1 |
sudo yum install epel-release |
然后再安装 iperf3
1 |
sudo yum install iperf3 |
1 |
iperf3 -s |
开启一个端口监听
1 |
iperf3 -u -c 192.168.3.116 5201 -t 60 -i 2 -b 100M |
参数介绍 :
-u : UDP
-c : server ip and port
-t : 测多久
-i : 显示的interval
如果不带 -u , 就是tcp 连接
-b: 指定带宽 100M
http://www.slyar.com/blog/iperf-measure-network-performance.html