Avamar:如何使用 Linux 和 UNIX 用戶端的前指令檔與後指令檔

Summary: 某些應用程式可能需要在執行或完成備份時停止並重新啟動。 若要執行此程序,您可以使用 Linux/UNIX/AIX/HP-UX/OSX Avamar 用戶端的資料集來執行此程序。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

某些應用程式可能需要在備份開始前停止,並在備份結束時重新啟動。可以使用帶有數據集的 prescripts 和 postscript 執行此過程 Linux/UNIX/AIX/HP-UX/OSX Avamar 用戶端。

要運行任何前後腳本,它們必須是可執行的並放置在: /usr/local/avamar/etc/scripts
如需詳細資訊,請參閱 Avamar 管理指南。

如果指令檔無法如預期執行,建議您聯絡 Dell 專業服務以取得協助。

若要確認前述和後記在 Avamar 中可正常運作,請建立將一些簡單資訊輸出至文字檔案的簡單指令檔。

樣本 bash 指令檔:
複製下面的內容並將其放在名為 test.sh 在用戶端上:

#!/bin/bash
echo "Testing script" > test.txt

Perl 指令檔範例:
複製下面的內容並將其放在名為 test.pl 在用戶端上:

#!/usr/bin/perl
use strict;
use warnings;
my $file = ("perlscriptest.txt");
open(FILE, ">$file") || die("Couldn't open file");
print FILE "testing perl script\n";
close (FILE);
exit (0);

將指令檔存取控制清單 (ACL) 變更為要執行的所有指令檔:

chmod a+x script_filename
將測試指令檔放入: /usr/local/avamar/etc/scripts
新增 script_filename 到數據集 的高級 選項中的腳本。
執行測試備份test.txt,並在 /usr/local/avamar/etc/scripts

取得文稿錯誤
2013-04-02 13:29:07 avtar Info <5916>: Executing run-at-start '/usr/local/avamar/etc/scripts/BDAbackupscript.sh'
2013-04-02 13:29:08 avtar Info <6033>: Begin STDERR from run-at-start:
avspawn::spawn after execve errno:8 code 8: Exec format error
2013-04-02 13:29:08 avtar Info <6034>: End of STDERR
2013-04-02 13:29:08 avtar Info <5917>: Back from run-at-start, exit code 8
2013-04-02 13:29:08 avtar Error <7001>: Exiting avtar with run-at-start script failure 8

在此錯誤中,Avamar 會尋找指令檔語法,並嘗試識別用來叫用指令檔的 shell。

當指令檔與標誌一起使用時 --run-at-start--run-at-end 標誌,腳本的第一行必須定義要使用的shell。
通用定義:

"#!<program>"

這是使用腳本時的標準做法。它定義運行shell代碼的shell或命令處理器。

例如:
SH 指令檔的開頭為:

#!/bin/sh

CSH 指令檔的開頭為:

#!/bin/csh

PERL 指令檔的開頭為:

#!/usr/bin/perl

客戶負責代碼的正確運行。

如果執行前述或後記時發生任何問題,客戶應負責。Avamar 不負責除錯指令檔或確保使用正確的語法。

Affected Products

Avamar

Products

Avamar, Avamar Client
Article Properties
Article Number: 000014472
Article Type: How To
Last Modified: 18 Sept 2025
Version:  5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.