Schtasks command to understand the application of Scheduler

Source: Internet
Author: User
Tags failover schtasks

Understand the advanced version of the Windows Server Schedule (job) at command:

Schtasks/CREATE Command

To create a schedule, you must have

1. scheduler name (unique)

TN: Task Name (required)

 

2. What program does the program provide?

TR: Task run (required)

 

3. What does it use?

RU: run user (required)

RP: Run password (required)

 

4. Re-head failover: failover Rate

SC: Schedule (required)

Every minute or hour or every day/week/month?

 

If every is to be true, it is not very active, so it provides another interval.

MO: modifier (Mo 1)

That is, the operation is performed every hour, hourly hour, daily, weekly, and monthly.

 

5. When will it take?

A program always has a precise Start Time

St: starttime)

 

This time is expressed in minutes

What about the rows whose shards have to be merged and whose shards have to be merged?

Of course, it is whenStartEvery minute and every three minutes is taken once.

 

6. With the start time, there is a time to stop the row.

Et: endtime

Every minute when a row is created and every hour when a row is scheduled, you may only need to wait until and do not need to schedule the rows.

 

But what if it is a daily, weekly, or monthly renewal?

You do not need to renew your subscription for one time. You do not need to renew your subscription for a week or a month)

Does the end time mean nothing?

In the same way, this leads to if the row is renewed by day, week, or month, is it true?

The answer is no.

For example, if you want to schedule a row at a rate of two days, you may need to renew the row at a rate of three minutes within the specified row date, once in the morning, once in the afternoon, or once every three minutes.

In the same way, the preceding schedule also exists in the monthly schedule, and you also need to repeat the rows.

 

7. This is the daily, weekly, and monthly reconnection interval (in minutes)

RI: Run interval (if et exists, or the following du, it is regarded as 10 minutes)

 

With this thing, the et above will be effective for the day, month, and week.

Yan Ming's classmates may come up

Based on the ratio of each day, and then repeat the interval

It should be able to replace the SC setting for every minute.

The answer is incorrect.

Windows's scheduling interface does not enable you to choose the average rate per minute.

Well, for the sake of simplicity, I think the renewal rate is only small to the day, week, month, and so on, the shard refers to the duplicate shard row of the daily shard row.

 

8. Return to the end time

It is possible to set a correct time frame for the end.

Du: Duration

However, you can also set the number of minutes for the fixed-weight rows to be stopped.

In fact, in the scheduling management interface of win2003, the number of bytes that are imported into et is calculated as du.

Therefore, the two tables are actually different.

However, in general, it is more convenient for me to use et.

 

9. well, for example, the rows in which the reading rate is very intensive, such as one row per minute, but the time of a Certain Row may exceed one minute, do you want to schedule the next schedule?

If you don't want to trigger

K: Kill

Right

 

10. Let's discuss the date later.

For every day (every hour, every minute is not enough), there is no specific date to choose, every day

For a week, you can choose to renew the week.

D: days Mon, Tue...

You can set multiple

 

You can choose to renew your monthly subscription.

D: days 1, 2, 5...

Months of renewal

M: months Jan, Feb...

 

In addition, if the row is renewed every month

In this example, there is a special case of Mo (Mo does not indicate that the row is written every other month)

Mo can be set to first, second, last, lastday, etc.

Then set the week in D.

Indicates the First, Second, last week, and last day of each month.

 

11. Okay, with the start time and End Time

The start date and end date are the same.

Every minute or hour

Or daily, weekly, or monthly

You can set the start date and end date.

SD: Start Date (today)

ED: End Date

 

12. Establish the scheme System

/F

When the previous job name already exists, the corresponding row is updated.

 

Besides the SC failover rate mentioned above

The following SC types are available:

Once, onstart, onlogon, onidle

Generally, it is used less than least in the system.

So there is no concern

 

It can pass through schtasks/create /?

To retrieve all information

 

In addition, for non-English Operating Systems

For example, traditional Chinese operating systems

This command is quite variable.

SC, M, D, and other optional statements

Such as daily, hourly, and monthly

Such as Monday and Tuesday

For example, January (this has never been successful, and I don't know what to replace Jan, Feb, etc)

 

The two examples are as follows:

Establish a scheduler test in the Compile System

Xxx.exe is executed every 3 minutes, from AM to AM.

If the row is still being deleted, the row is not deleted.

Schtasks/create/TN test/F

/TR xxx.exe

/Ru useracount/RP Password

/SC dayly

/ST

/Et22:00

/RI 3

/K

 

Establish a scheduler test in the Compile System

5 RMB in January and March every year

Starting from A.M. To a.m., every 5 minutes can be used for xxx.exe

If the row is still being deleted, the row is not deleted.

Schtasks/create/TN test/F

/TR xxx.exe

/Ru useracount/RP Password

/SC monthly

/M Jan, MAR

/D 5

/St 10: 00

/Et22:00

/Ri 5

/K

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.