Calendar ZH
From MLDonkey
Contents |
排程
排程可以让你的mldonkey的 命令 按时间表(即排程)来定期运行(类似 cron)
语法
排程是存储在您的Downloads.ini文件中的,它的语法是:
calendar = [
([0;1;...;6;], [0;1;...;23;], "command1" );
([0;1;...;6;], [0;1;...;23;], "command2" );
... ]
- 第一个参数包含一个将被执行的星期参数上的命令(
星期日= 0,星期一= 1,星期二= 2,...,星期六= 6). - 第二个参数包含一个列表的时间在24小时格式()在该命令将被执行 (
0 ... 24). - 第三个也是最后一个参数是命令本身。
日期,时间和命令可以指定由分号分隔它们。
入门
You can quickly schedule commands to execute every day with the calendar_add command:
calendar_add hour "command"
编辑downloads.ini之前请尝试使用calendar_add命令,以确保您得到正确的格式。
范例
简单
若你运行如下命令:
> calendar_add 8 "set max_upload_rate 10" > calendar_add 22 "set max_upload_rate 0"
你将从你的排程中,在你的downloads.ini文件中得到如下:
calendar = [
([
0;
1;
2;
3;
4;
5;
6;], [
22;], "set max_upload_rate 0");
([
0;
1;
2;
3;
4;
5;
6;], [
8;], "set max_upload_rate 10");]
请注意mldonkey的排程命令的格式。每次您运行命令它都将为此而停止mldonkey的守护进程/服务。
复杂
经过一些试验和调整,我想出了我个人的复杂的日历。不要试图去了解它!
这是由命令返回的vCal摘要:> vcal weekdays / hours / command : 1 2 3 4 5 6 set max_hard_download_rate 1 1 2 3 4 5 6 set max_hard_upload_rate 10 1 2 3 5 9 set max_hard_download_rate 0 1 2 3 5 9 set max_hard_upload_rate 0 4 10 set max_hard_download_rate 0 4 10 set max_hard_upload_rate 0 1 2 3 4 5 13 set max_hard_download_rate 1 1 2 3 4 5 13 set max_hard_upload_rate 10 1 2 3 4 5 22 set max_hard_download_rate 0 1 2 3 4 5 22 set max_hard_upload_rate 0 6 7 set max_hard_upload_rate 10 6 7 set max_hard_download_rate 1 6 22 set max_hard_upload_rate 0 6 22 set max_hard_download_rate 0 0 14 set max_hard_upload_rate 10 0 14 set max_hard_download_rate 1 0 20 set max_hard_upload_rate 0 0 20 set max_hard_download_rate 0
这是downloads.ini文件的实际内容:
calendar = [
([
1;
2;
3;
4;
5;], [
6;], "set max_hard_download_rate 1");
([
1;
2;
3;
4;
5;], [
6;], "set max_hard_upload_rate 10");
([
1;
2;
3;
5;], [
9;], "set max_hard_download_rate 0");
([
1;
2;
3;
5;], [
9;], "set max_hard_upload_rate 0");
([
4;], [
10;], "set max_hard_download_rate 0");
([
4;], [
10;], "set max_hard_upload_rate 0");
([
1;
2;
3;
4;
5;], [
13;], "set max_hard_download_rate 1");
([
1;
2;
3;
4;
5;], [
13;], "set max_hard_upload_rate 10");
([
1;
2;
3;
4;
5;], [
22;], "set max_hard_download_rate 0");
([
1;
2;
3;
4;
5;], [
22;], "set max_hard_upload_rate 0");
([
6;], [
7;], "set max_hard_upload_rate 10");
([
6;], [
7;], "set max_hard_download_rate 1");
([
6;], [
22;], "set max_hard_upload_rate 0");
([
6;], [
22;], "set max_hard_download_rate 0");
([
0;], [
14;], "set max_hard_upload_rate 10");
([
0;], [
14;], "set max_hard_download_rate 1");
([
0;], [
20;], "set max_hard_upload_rate 0");
([
0;], [
20;], "set max_hard_download_rate 0");]