---
schema_version: "1"
id: c2ff38bbc85fc7a0fa865eb7bbd23f5d1598796985521c7ef9f3e4944f1d21e7
title: tsm File Paths
collection: tableau
version: next
locale: zh-cn
portal_url: https://docs.salesforce.com/tableau/next/zh-cn/server-linux/cli_default_filepaths_tsm.md
canonical_url: https://help.tableau.com/v0.0/server-linux/zh-cn/cli_default_filepaths_tsm.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 4c0b6635b7a4e7c0ee65954a1c8d281f451c2b99e9669d971dd117583025ca44
description: View and change the default file path locations tsm commands use for backups and other files.
---
[跳转到主要内容](#main-content)

# tsm File Paths

某些 tsm 命令都从默认位置读取文件或将文件写入默认位置。这些默认位置由为每个命令定义的 `basefilepath` 配置键确定。您可以使用 tsm 来查看键的当前值，以及更改位置。

## 文件的默认位置

在 `tsm maintenance backup`、`restore`、 和 `ziplogs` 过程中以及 `tsm sites export` 和 `sites import` 过程中，Tableau Server 为这些命令创建或使用的文件使用默认位置。

有关备份 Tableau Server 的磁盘空间要求的详细信息，请参见[备份的磁盘空间使用情况](https://help.tableau.com/v0.0/server-linux/zh-cn/db_backup.htm#BackupDiskSpaceReqs)。

默认情况下：

- Tsm 维护命令
    
    - **backup** — 备份`.tsbak` 文件在初始节点上数据目录中的临时位置中创建，然后保存在：
        
        `` `/var/opt/tableau/tableau_server/data/tabsvc/files/backups/` ``
        
        - **backup** — 临时暂存位置。备份`.tsbak` 文件在初始节点上数据目录中的临时位置中创建。
            
            从版本 2026.2.0 开始，您可以指定用于创建备份文件的备用临时位置。如果备份文件很大或初始节点上的空间有限，这可能很有用。有关详细信息，请参见[backuprestore.use\_custom\_staging\_dir.enabled](https://help.tableau.com/v0.0/server-linux/zh-cn/cli_configuration-set_tsm.htm#backuprestore_staging)。
    - restore — restore 过程从以下位置还原备份文件：
        
        `` `/var/opt/tableau/tableau_server/data/tabsvc/files/backups/` ``
    - ziplogs — 将在以下位置中生成 ziplogs 文件：
        
        `/var/opt/tableau/tableau_server/data/tabsvc/files/log-archives`
- tsm sites
    
    - export — 将在以下目录中生成导出 .zip 文件：
        
        `/var/opt/tableau/tableau_server/data/tabsvc/files/siteexports`
    - import — 在导入过程中，Tableau Server 将在以下位置中查找文件：
        
        `/var/opt/tableau/tableau_server/data/tabsvc/files/siteimports`

## 获取当前文件位置

可以使用 `tsm configuration get` 查看特定命令的当前文件位置：

- 对于 tsm 维护命令：
    
    - backup 和 restore：
        
        `tsm configuration get -k basefilepath.backuprestore`
    - ziplogs：
        
        `tsm configuration get -k basefilepath.log_archive`
- 对于 tsm 站点命令：
    
    - export
        
        `tsm configuration get -k basefilepath.site_export.exports`
    - import
        
        `tsm configuration get -k basefilepath.site_import.exports`

## 更改当前 basefilepath 位置

您可以使用 `tsm configuration set` 命令更新 `basefilepath` 变量以更改 TSM 用于文件操作的一些位置。有关特定基本文件路径的详细信息，请参见[tsm configuration set 选项](https://help.tableau.com/v0.0/server-linux/zh-cn/cli_configuration-set_tsm.htm)。

更改 `basefilepath` 变量不会将现有文件从原始目录移到新目录。如果希望现有备份、还原、日志文件或者站点导出或导入文件位于指定的新目录中，您必须手动移动这些文件。您负责创建新的位置并设置正确的权限，以允许 TSM 访问将放置在那里的任何文件，以及包含这些文件的目录结构。有关权限和 TSM 的详细信息，请参阅[TSM 中的文件和权限](https://help.tableau.com/v0.0/server-linux/zh-cn/file_permissions_tsm.htm)。如果您更改备份/还原基本文件路径，则应运行 [tsm maintenance validate-backup-basefilepath](https://help.tableau.com/v0.0/server-linux/zh-cn/cli_maintenance_tsm.htm#tsmValidateBackupBasefilepath) 命令（在 2022.1 及更高版本中可用）以验证权限设置是否正确。

在将备份文件保存到 `basefilepath.backuprestore` 变量指定的位置之前，`tsm maintenance backup` 命令使用数据目录中的临时暂存位置进行文件操作（汇编、提取）。从版本 2026.2.0 开始，如果将 TSM 配置为使用 `basefilepath.backuprestore` 指定的位置，并且备份将汇编在 `basefilepath.backuprestore` 指定的位置下的临时子目录中。对于 2026.2.0 之前的版本，更改 basefilepath 不会影响 `tsm maintenance backup` 命令汇编备份文件的位置。

- 对于 tsm 维护命令：
    
    - `backup` 和 `restore`
        
        若要更改 `backup` 和 `restore` 命令使用的目录，请运行以下命令：
        
        `tsm configuration set -k basefilepath.backuprestore -v "/new/directory/path"`
    - `backup` 暂存位置
        
        **注意：**从版本 2026.2.0 开始，可以更改暂存位置。
        
        若要将 `backup` 使用的临时暂存位置更改为 `basefilepath.backuprestore` 位置下的子目录，请运行以下命令：
        
        `tsm configuration set -k backuprestore.use_custom_staging_dir.enabled -v true`
        
        当设置为 `true` 时，`backup` 命令使用由 `basefilepath.backuprestore` 值指定的位置下的临时目录。
    - 更改 ziplogs 目录：
        
        `tsm configuration set -k basefilepath.log_archive -v "/new/directory/path"`
- 对于 tsm 站点命令：
    
    - 更改站点导出目录：
        
        `tsm configuration set -k basefilepath.site_export.exports -v "/new/directory/path"`
    - 更改站点导入目录：
        
        `tsm configuration set -k basefilepath.site_import.exports -v "/new/directory/path"`

更改默认文件位置之后，您需要执行以下操作：

1. 应用待处理的更改：
    
    `tsm pending-changes apply`
    
    如果待定更改需要重新启动服务器，`pending-changes apply` 命令将显示一个提示，告知您将进行重新启动。即使服务器已停止，此提示也会显示，但在这种情况下不会重新启动。您可以使用 `--ignore-prompt` 选项隐藏提示，但这样做不会改变重新启动行为。如果更改不需要重新启动，则会在不提示的情况下应用更改。有关详细信息，请参见[tsm pending-changes apply](https://help.tableau.com/v0.0/server-linux/zh-cn/cli_pending-changes.htm#pending-changes-apply)。
2. 停止 Tableau Server：
    
    `tsm stop`
3. （以 _tableau_ 系统帐户身份）重新启动 TSM 控制器：
    
    `sudo su -l tableau -c "systemctl --user restart tabadmincontroller_0.service"`
4. 等待几分钟，让控制器重新启动。您可以使用此命令确认控制器是否已重新启动：
    
    `tsm status -v`
    
    当您可以运行该命令并且 Tableau Server 管理控制器被列为“正在运行”时，控制器已重新启动。
5. 启动 Tableau Server：
    
    `tsm start`