---
title: "脚本库"
description: "在宝塔面板（BT Panel）「计划任务 → 脚本库」中使用官方脚本或上传自定义 Python / Shell 脚本，支持脚本参数、返回类型与编码声明，供计划任务反复调用。"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.bt.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 脚本库

本文将介绍脚本库的使用方法。

在脚本库内，您可以找到宝塔面板官方提供的各种常用脚本，您也可以上传自己的脚本到脚本库，需要的时候直接使用。

## 操作步骤

1. 登录宝塔面板。点击左侧导航栏的`计划任务`，进入计划任务列表页面。
    
    ![导航栏-计划任务](/img/user-guide/crontab/lts-sidebar-task.png)

2. 点击顶部导航栏的`脚本库`，进入脚本库页面。
   
   ![脚本库](/img/user-guide/crontab/lts-library.png)

3. 点击`创建脚本`，进入创建脚本页面。
   
   ![创建脚本](/img/user-guide/crontab/lts-create-script.png)

4. 填写脚本信息，点击`提交`，即可创建脚本。
   
   ![填写脚本信息](/img/user-guide/crontab/lts-create-script-info.png)

:::info[说明]
- 当前仅支持Python和Shell脚本
- 请根据返回类型在脚本执行结束时输出符合预期的值
- 如果选择需要脚本参数，使用当前脚本时需传递一个参数，在脚本中的第一个参数中接收
- Python 脚本需指定编码（如 #coding: utf-8）；Shell 脚本可以用 #!/bin/bash 或 #!/bin/sh 开头，未指定类型时默认按 Shell 脚本执行。
:::

Source: https://docs.bt.cn/user-guide/crontab/library/index.mdx
