Task Scheduler
Task Scheduler allows you to schedule and run services or scripts at pre-defined times.
Supported Tasks
Tasks can be created to carry out the following:
- User-defined script: Run user-defined scripts or commands.
- Recycle bin: Empty the Recycle Bin of specific shared folders. Additionally, Retention Policy settings allow you to control which files are permanently deleted when emptying the Recycle Bin. For example, files can be deleted or retained based on their size, deletion time, or file format.
- Beep Control: Activate the Synology NAS beep.
- Service: Start or stop network services, such as Windows File Service, FTP, Auto Block, etc.
Managing Tasks
The main page of Task Scheduler displays all existing tasks and provides options to create, edit, or run tasks.
To create a scheduled task:
Scheduled tasks are tasks that run on a specified date, time, or interval.
- Go to Control Panel > Task Scheduler, click Create, and select Scheduled Task.
- Select the desired type of tasks: User-defined script, Recycle Bin, Beep Control, or Service.
- When the Create task window appears, click General and modify the following settings:
- General Settings: Enter a task name, select a user for whom to run the task, and enable or disable the task.
- Click Schedule and modify the following settings:
- Date: Specify when to run the task. Tasks can be scheduled to run on certain days of the week (e.g., daily, weekly, monthly) or on specific dates (e.g., 2023/07/21).
- Time: Specify the number of times the task runs each day, as well as the first and last run time.
- Click Task Settings to configure task-specific settings (only for certain tasks).
- To receive run details of the task, select Send run details by email.
- To get notified only when abnormalities occur, select Send run details only when the script terminates abnormally.
- To customize the task content, enter the script under User-defined script.
- If you selected Recycle Bin or Service in Step 2, you can decide how and when Recycle Bins are cleared, or which service to start or stop.
- Click OK to save the settings.
To create a triggered task:
Triggered tasks are tasks that run before or after completion of specific events.
- Go to Control Panel > Task Scheduler, click Create, and select Triggered Task.
- Select User-defined script.
- When the Create task window appears, click General and modify the following settings:
- General Settings: Enter a task name, select a user for whom the task will run, select an event or pre-task that triggers the task, and enable or disable the task.
- Click Task Settings to configure task-specific settings (only for certain tasks).
- To receive run details of the task, select Send run details by email.
- To get notified only when abnormalities occur, select Send run details only when the script terminates abnormally.
- To customize the task content, enter the script under User-defined script.
- Click OK to save the settings.
Note:
- When creating a triggered task, you may have to specify its pre-task(s). The created task will run only after the pre-task is carried out.
- After you enable Send run details only when the script terminates abnormally, the system will not deliver the details if the script ends with 0.
To edit task settings:
- Select an existing task.
- Click Edit.
- A window will appear where you can modify the task settings.
To delete a task:
- Select an existing task.
- Click Action and select Delete.
To enable or disable a task:
- On the Task Scheduler main page, select or unselect the appropriate checkbox under Enabled to enable or disable a task.
- Click Apply.
To manually run a task:
- Select one or more existing tasks.
- Click Run.
To enable script output:
- On the Task Scheduler main page, click Settings.
- Select Save output results and click Select a folder to specify the destination for saving the output results. You can also click Create Folder to create a new destination folder.
- Run the script.
- On the Task Scheduler main page, click Action, and select View Results to check the results of the script.
Task Scheduler Limitations:
- Task names can include up to 130 displayable characters.
- Task names can only include English characters, numbers, and spaces, and cannot start or end with spaces.
- Maximum number of tasks: 1,024.
- Maximum length of script path or command line: 4,095.
- Beep duration can be set from 1 to 600 seconds.
- An email notification contains a maximum of 1 MB of task results.