Skip to main content

USBCopy

Overview

USB Copy API wrapper for Synology NAS.

Methods

Getters :

  • Get package settings
  • Get package logs
  • Get task settings

Actions :

  • Enable / Disable task

Methods

get_package_settings

Retrieve package settings.

Internal API

SYNO.USBCopy

Returns

dict[str, object]
Parsed JSON into a dictionary.

Example return

Click to expand
    {
"data": {
"beep_on_task_start_end": True,
"log_rotate_count": 100000,
"repo_volume_path": "/volume2"
},
"success": True
}

get_package_logs

Retrieve package logs.

Internal API

SYNO.USBCopy

Parameters

offset int
Offset for logs. Defaults to 0.

limit int
Maximum number of logs to retrieve. Defaults to 200.

Returns

dict[str, object]
Parsed response JSON into a dictionary.

Example return

Click to expand
    {
"data": {
"count": 1,
"log_list": [
{
"description_id": 101,
"description_parameter": "["asdf"]",
"error": 0,
"log_type": 1,
"task_id": 2,
"timestamp": 1738341351
}
]
},
"success": True
}

get_task_settings

Retrieve task settings.

Internal API

SYNO.USBCopy

Parameters

task_id int
Task ID to retrieve info for.

Returns

dict[str, object]
Parsed response JSON into a dictionary.

Example return

Click to expand
    {
"data": {
"task": {
"conflict_policy": "rename",
"copy_file_path": "",
"copy_strategy": "versioning",
"default_device_port": "NA",
"destination_path": "[USB]",
"eject_when_task_done": True,
"enable_rotation": False,
"error_code": 0,
"id": 2,
"is_default_task": False,
"is_ds_mounted": False,
"is_task_runnable": False,
"is_usb_mounted": False,
"latest_finish_time": 1738341351,
"max_version_count": 256,
"name": "asdf",
"next_run_time": "N/A",
"not_keep_dir_structure": False,
"remove_src_file": False,
"rename_photo_video": False,
"rotation_policy": "oldest_version",
"run_when_plug_in": False,
"schedule_id": 13,
"smart_create_date_dir": False,
"source_path": "/music",
"status": "unmounted",
"type": "export_general"
}
},
"success": True
}

toggle_task

Enable or disable a USB Copy task.

Internal API

SYNO.USBCopy

Parameters

task_id int
Task ID to apply the setting to.

enable bool
Whether to enable (True) or disable (False) the USB Copy task. Defaults to True.

Returns

dict[str, object]
Parsed response JSON into a dictionary.

Example return

Click to expand
    {
"success": True
}