---
schema_version: "1"
id: b8848968c71e782dfe1b35d74301f877d51c585904739e29d6f479a627af53cd
title: tsm File Paths
collection: tableau
version: current
locale: zh-tw
portal_url: https://docs.salesforce.com/tableau/current/zh-tw/server-linux/cli_default_filepaths_tsm.md
canonical_url: https://help.tableau.com/current/server-linux/zh-tw/cli_default_filepaths_tsm.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 258ee1b6429bfc715919288c82c8f57f7b0ccf2c236d6724572eafe0612dccfc
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/current/server-linux/zh-tw/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/current/server-linux/zh-tw/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 維護命令：
    
    - 備份與還原 ：
        
        `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/current/server-linux/zh-tw/cli_configuration-set_tsm.htm)。

變更 `basefilepath` 變數不會將現有檔案從原始目錄移動至新目錄。如果希望現有備份、還原、記錄檔或者網站匯出或匯入檔位於指定的新目錄中，您必須手動移動這些檔。您負責建立新的位置並設定正確的使用權限，以允許 TSM 存取將放置在那裡的任何檔，以及包含這些檔的目錄結構。有關使用權限和 TSM 詳情，請參閱[TSM 中的檔案和權限](https://help.tableau.com/current/server-linux/zh-tw/file_permissions_tsm.htm)。若變更備份/還原基本檔案路徑，則應執行 [tsm maintenance validate-backup-basefilepath](https://help.tableau.com/current/server-linux/zh-tw/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`
        
        若要變更 `restore` 和 `backup` 使用的目錄， 請執行以下命令：
        
        `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/current/server-linux/zh-tw/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`