Skip to content

Instantly share code, notes, and snippets.

@michaelcoyote
Created August 15, 2014 18:07
Show Gist options
  • Save michaelcoyote/afba6700d04160b774a9 to your computer and use it in GitHub Desktop.
Save michaelcoyote/afba6700d04160b774a9 to your computer and use it in GitHub Desktop.
Useful Avamar cli commands for managing backups, clients, groups, policies, etc.
- Notes on avamar client configuration using command line
Generally scheduling of clients, setting retentions and datasets are done via groups (best practice).
It is recommended to work with the backup team to set up an agreed upon set of schedules, retentions and datasets
and assign these to group policies as needed.
With this in mind it is likely that you will only really need the command to list the group policies, add a client to a group and start a backup.
I have included the other commands in case they are needed to add context to a system.
The examples here are shown with output in plain text. Note that there is a "--xml" display option switch to show all command output
in XML format if desired.
- Configure the backups on the client
To list the group policies on an Avamar:
mccli group show --recursive=true
0,23000,CLI command completed successfully.
Group Domain Type
------------------- ------- ------
Default Group / Normal
Default Proxy Group / Normal
TestGroup / Normal
group01 /test01 Normal
To show the specific attributes of a given policy, use the --name switch
mccli group show --name="Default Group"
0,23000,CLI command completed successfully.
Attribute Value
----------------- ------------------
Name Default Group
Domain /
Type Normal
Enabled false
Dataset /Default Dataset
Schedule /Default Schedule
Retention Policy /Default Retention
Encryption Method High
To add a client to a group policy:
mccli group add-client --name="TestGroup" --client-name=/test01/testclient01
0,22243,Client group membership successfully updated.
To review client group membership run the mccli client show command and grep for "Member of Group"
mccli client show --name=/test01/testclient01 |grep Member\ of\ Group
Member of Group /TestGroup
Member of Group /test01/group01
Member of Group /Default Group
To review members of a particular group and list the clients:
mccli group show-members --name=/test01/group01
0,23000,CLI command completed successfully.
Group Group Type Client Client Type
--------------- ---------- -------------------- -----------
/test01/group01 Normal /test01/testclient01 Normal
Note that the client can belong to more than one group and that the client will always need to be a member of one group
To remove a client from a group:
mccli group remove-client --name="Default Group" --client-name=/test01/testclient01
0,22243,Client group membership successfully updated.
To add a client to a group:
mccli group add-client --name="Default Group" --client-name=/test01/testclient01
- Subscribe backup on avamar server based on policies
As mentioned above, it is unlikely that these commands will be needed for anything other than to add context to existing policies.
Policies should be created and set by the backup admins and architects.
The backup dataset is set through the group policy. To view a dataset:
mccli dataset show --name=Windows\ Dataset
0,23000,CLI command completed successfully.
Attribute Value
----------------------------- -------------------------------------------------------
Name Windows Dataset
ID WINDOWS:SNAPID
Domain /
Built-in false
ALLDATA true
Num Targets 1
Windows File System Target ALL
Windows File System Target ID 3001
Num Includes 0
Num Excludes 0
Num Flags 24
Windows File System Flag type=checkbox:name=[]default-traversal:value=true
Windows File System Flag type=checkbox:name=backup_mounted_vhds:value=true
Windows File System Flag type=checkbox:name=backupsystem:value=false
Windows File System Flag type=checkbox:name=checkcache:value=false
Windows File System Flag type=checkbox:name=ddr:value=false
Windows File System Flag type=checkbox:name=debug:value=false
Windows File System Flag type=checkbox:name=detect-acl-changes:value=false
Windows File System Flag type=integer:name=filecachemax:value=-8
Windows File System Flag type=checkbox:name=force:value=false
Windows File System Flag type=integer:name=freezecachesize:value=-50
Windows File System Flag type=pulldown:name=freezemethod:value=best
Windows File System Flag type=integer:name=freezetimeout:value=300
Windows File System Flag type=integer:name=freezewait:value=4
Windows File System Flag type=integer:name=hashcachemax:value=-16
Windows File System Flag type=pulldown:name=informationals:value=2
Windows File System Flag type=checkbox:name=one-file-system:value=false
Windows File System Flag type=pulldown:name=protect-profile:value=disabled
Windows File System Flag type=checkbox:name=repaircache:value=false
Windows File System Flag type=checkbox:name=run-after-freeze-exit:value=true
Windows File System Flag type=checkbox:name=run-at-end-exit:value=true
Windows File System Flag type=checkbox:name=run-at-start-exit:value=true
Windows File System Flag type=checkbox:name=statistics:value=false
Windows File System Flag type=pulldown:name=verbose:value=0
Windows File System Flag type=checkbox:name=windows-optimized-backup:value=false
Is Link false
Retention policy is set through the group policy. To view a rentention policy:
mccli retention show --name=/test01/testret01
0,23000,CLI command completed successfully.
Attribute Value
---------------------- ---------
Name testret01
Domain /test01
Basic Expiration Date 60 days
Override Yes
Keep DAYS of Daily 60
Keep WEEKS of Weekly 0
Keep MONTHS of Monthly 0
Keep YEARS of Yearly 0
- Schedule backups on avamar server
Scheduling is done via group policies. It is recommended that the client is added to the group policy with the desired schedule.
If you need to know the configured schedules on an Avamar:
Use this command to show the schedules
mccli schedule show [--domain=STRING(/)] [--name=STRING] [--recursive=BOOLEAN(false)] [--verbose=BOOLEAN(false)]
Output looks like this:
mccli schedule show
0,23000,CLI command completed successfully.
Schedule Domain
---------------------------- ------
Daily Schedule /
Default Replication Schedule /
Default Schedule /
Evaluation Schedule /
Notification Schedule /
Override Daily Schedule /
Statistics Schedule /
To review the attributes of a specific schedule use the --name= parameter
mccli schedule show --name="Daily Schedule"
0,23000,CLI command completed successfully.
Attribute Value
------------------------------- ---------------------------------
Name Daily Schedule
Domain /
Built-in true
Native Timezone America/Los_Angeles
Daylight Savings Adjustment (m) 60
Next Run Time 2013-12-06 01:00 AM
Start Time 10:00 PM Pacific Daylight Time
Backup Window Duration 8 hours and 0 minutes
Repeat Weekly
Days of Week Sun, Mon, Tue, Wed, Thu, Fri, Sat
Delay Start Until 2013-09-24 05:28 PM
End Policy No End Date
Description Internal daily schedule
- Modify Datasets.
To add the CPU Throttle option to the Linux FS plugin of a dataset
mccli dataset add-option --plugin=1001 --name=/test01/t01-linux-ds --option=cpu-throttle --value=50
0,22220,Dataset modified
Change the CPU Throttle option
mccli dataset edit-option --plugin=1001 --name=/test01/t01-linux-ds --option=cpu-throttle --value=1
0,22220,Dataset modified
Remove the CPU Throttle option
mccli dataset delete-option --plugin=1001 --name=/test01/t01-linux-ds --option=cpu-throttle
0,22220,Dataset modified
List a dataset
root@ave-03:~/#: mccli dataset show --name=/test01/t01-linux-ds
0,23000,CLI command completed successfully.
Attribute Value
--------------------------- -------------------------------------------------
Name t01-linux-ds
ID 1386725402443
Domain /test01
Built-in false
ALLDATA false
Num Targets 1
Linux File System Target ALL
Linux File System Target ID 1001
Num Includes 0
Num Excludes 0
Num Flags 15
Linux File System Flag type=checkbox:name=[]default-traversal:value=true
Linux File System Flag type=checkbox:name=checkcache:value=false
Linux File System Flag type=int:name=cpu-throttle:value=50
Linux File System Flag type=pulldown:name=ddr-index:value=0
Linux File System Flag type=checkbox:name=debug:value=false
Linux File System Flag type=integer:name=filecachemax:value=-8
Linux File System Flag type=checkbox:name=force:value=false
Linux File System Flag type=integer:name=hashcachemax:value=-16
Linux File System Flag type=pulldown:name=informationals:value=2
Linux File System Flag type=checkbox:name=one-file-system:value=false
Linux File System Flag type=checkbox:name=repaircache:value=false
Linux File System Flag type=checkbox:name=run-at-end-exit:value=true
Linux File System Flag type=checkbox:name=run-at-start-exit:value=true
Linux File System Flag type=checkbox:name=statistics:value=false
Linux File System Flag type=pulldown:name=verbose:value=0
Is Link false
- Execute backups based on the policies defined
Run the client backup against the group policies:
mccli client backup-group-dataset --name="/test01/testclient01" --group-name="/test01/group01"
0,22305,client backup scheduled.
Attribute Value
----------- --------------------
client /test01/testclient01
group /test01/group01
activity-id 9138627362589009
Display the status of a given operation based on the activity-id
mccli activity show --id=9138627362589009
0,23000,CLI command completed successfully.
ID Status Error Code Start Time Elapsed End Time Type Progress Bytes New Bytes Client Domain
---------------- --------------------- ---------- -------------------- ----------- -------------------- ---------------- -------------- --------- ------------ -------
9138627362589009 Client Not Registered 0 2013-12-05 15:00 EST 00h:00m:00s 2013-12-05 15:00 EST On-Demand Backup 0 bytes 0% testclient01 /test01
mccli activity show --id=9138672731519209
0,23000,CLI command completed successfully.
ID Status Error Code Start Time Elapsed End Time Type Progress Bytes New Bytes Client Domain
---------------- --------- ---------- -------------------- ----------- -------------------- ---------------- -------------- --------- -------- -------
9138672731519209 Completed 0 2013-12-10 21:01 EST 00h:04m:14s 2013-12-10 21:06 EST On-Demand Backup 1.7 GB 16.6% lguest-2 /test01
Display the log for a client based on the activity-id
run mccli activity get-log --completed=true --id=9138627362589009
- Client software install
Client Install varies by type
Linux
Run installer (rpm) against install package
rpm -ih AVAMAR-LINUX.RPM
########################################### [100%]
########################################### [100%]
Installation complete
You may run /usr/local/avamar/bin/avregister to register and
activate this client with the Administrator server.
avagent Info <5241>: Logging to /usr/local/avamar/var/avagent.log
avagent Info <5417>: daemonized as process id 2066
avagent.d Info: Client Agent started.
Register against Avamar:
/usr/local/avamar/bin/avregister
=== Client Registration and Activation
This script will register and activate the client with the
Administrator server.
Enter the Administrator server address (DNS text name or numeric
IP address, DNS name preferred):
avamar-server.example.com
Enter the Avamar server domain [clients]:
test01
avagent.d Info: Stopping Avamar Client Agent (avagent)...
avagent.d Info: Client Agent stopped. [ OK ]
avagent Info <5241>: Logging to /usr/local/avamar/var/avagent.log
avagent.d Info: Client activated successfully. [ OK ]
avagent Info <5241>: Logging to /usr/local/avamar/var/avagent.log
avagent Info <5417>: daemonized as process id 3385
avagent.d Info: Client Agent started. [ OK ]
Registration Complete.
Alternately you can use avagent to register
avagent register avamar-server.example.com test01
Windows
Run installer
Register command
avregister.bat avamar-server.example.com test01
avamar-server.example.com
Download link: https://avamar-server.example.com/dtlt/home.html#downloads
@gcfajdurden
Copy link

gcfajdurden commented Oct 6, 2022

Thank you these were very helpful.
Do you happen to know the cli command to move backup policies to another directory? Change the backup domain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment