===== Commvault ===== More info on Commvault commandline and xml templates [[https://documentation.commvault.com/commvault/v11/article?p=20424.htm|here]]
* [[https://support.bull.com/ols/product/storage/backup/calypso/release_9_0_0/books_online_1/english_us/prod_info/features.htm?var1=https://support.bull.com/ols/product/storage/backup/calypso/release_9_0_0/books_online_1/english_us/features/cli/qcommands.htm]]
==== Useful Q commands ====
Login
qlogin -cs -u -clp
qlogin -cs 212.113.81.130 -u stuartb -clp ****** -f /home/oracle/token
* List client groups (Customers)
qlist clientgroup
* List clients (servers for all customers)
qlist client|grep AIX
* List data agents
qlist dataagent -c
qlist dataagent -c CI00244429-hn5124
NAME DESCRIPTION ACTIVE
---- ----------- ------
Q_FILESYSTEM File System Yes
Q_ORACLE Oracle Yes
* List running jobs on a client
qlist jobsummary -c
qlist jobsummary -c CI00217190-hn5224
RUNNING PENDING WAITING QUEUED SUSPENDED TOTAL
------- ------- ------- ------ --------- -----
1 0 0 0 0 1
* List the backup history of an instance
qlist jobhistory -dispJobTime -c CI00244429-hn5124 -a Q_ORACLE -i creltt1
JOBID STATUS STORAGE POLICY BACKUPSET SUBCLIENT INSTANCE StartTime EndTime
----- ------ -------------- --------- --------- -------- --------- -------
104026580 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/05 19:15:29 2023/06/05 19:18:05
104023170 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/05 18:15:39 2023/06/05 19:11:34
104020238 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/05 17:15:26 2023/06/05 17:24:11
104018061 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/05 16:15:30 2023/06/05 16:21:44
104016014 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/05 15:15:27 2023/06/05 15:22:10
104014018 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/05 14:15:30 2023/06/05 14:24:10
103912734 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/04 02:15:33 2023/06/04 03:12:33
103911105 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default Daily creltt1 2023/06/04 02:00:23 2023/06/05 18:00:21
103909192 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/04 01:15:30 2023/06/04 01:21:42
103905832 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/04 00:19:17 2023/06/04 00:24:17
103901909 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/03 23:15:35 2023/06/03 23:16:57
103898857 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/03 22:15:34 2023/06/03 22:16:56
103895191 Completed SP_Custom_Preferred_1_month_Replicated_1_week_App_Has default ArchiveLog creltt1 2023/06/03 21:15:22 2023/06/03 21:16:28
* List all schedule policies
qlist schedulepolicy
Schedule Policy Agent Type Enabled/Disabled
--------------- ---------- ----------------
SCP_Oracle_19u00_Full_Wednesday All Agent Types Enabled
SCP_Oracle_20u00_Full_Thursday All Agent Types Enabled
SCP_Oracle_20u00_Full_Sunday All Agent Types Enabled
SCP_Oracle_21u00_Full_Monday All Agent Types Enabled
SCP_Oracle_22u00_Full_Tuesday All Agent Types Enabled
SCP_Oracle_02u00_Full_Wednesday All Agent Types Enabled
SCP_Oracle_2400u_Full_Thursday All Agent Types Enabled
SCP_Oracle_18u15_Full_Tuesday All Agent Types Enabled
...
* List all storage policies
qlist sp
SP_Custom_Preferred_1_month_Replicated_1_week_App_2_Has
SP_Custom_Preferred_1_month_Replicated_1_week_App_2_Gel
SP_Custom_Preferred_1_month_Replicated_1_week_App_Has
SP_Custom_Preferred_1_month_Replicated_1_week_App_Gel
* List the subclients of a client
qlist subclient -c CI00244429-hn5124 -a Q_ORACLE -i creltt1
Daily
ArchiveLog
==== Backup a filesystem ====
This is an xml file describing what to backup
false
false
DATA_PROTECTION
IMMEDIATE
COMMANDLINE
GALAXY
Monthly_dump_lbk
defaultBackupSet
DefaultInstanceName
File System
CI00031689-HN1012
true
true
BACKUP
BACKUP
FULL
true
true
true
false
false
true
BEFORE_SYNTH
false
false
false
false
false
false
false
false
OVERWRITE
Following is a sort-of shell that would perform the backup with that xml file
#!/bin/sh
flag=0
response="Monthly_dump_l.tmp"
GALAXY_BASE=${GALAXY_BASE:-/opt/commvault/Base}
PATH=$PATH:$GALAXY_BASE; export PATH
qlogin -u "" -ps "" -cs "" -csn ""
if [ $? -ne 0 ]
then
echo Login failed.
else
while :
do
if [ "$1" ]
then
input=$input $1
shift
else
break;
fi
done
qoperation execute -af "Monthly_dump_lbk.xml" >$response
if [ $? -ne 0 ]
then
echo Failed to execute operation.
else
cat $response | \
while read line
do
echo $line
done
isJob=0
isJob=`grep -c "jobIds" $response`
if [ $isJob -ne 0 ]
then
sleep 120
qlist job -co is -af $response > output_1534491813.result
cat output_1534491813.result | \
while read line
do
echo $line
done
echo Processing...
while :
do
sleep 20
flag=0
qlist job -co is -af $response > output_1534491813.result
while read line
do
for word in $line
do
case $word in
Running*) flag=1; break 2; ;;
Waiting*) flag=1; break 2; ;;
Pending*) flag=1; break 2; ;;
Suspended*) flag=1; break 2; ;;
Queued*) flag=1; break 2; ;;
esac
done
done < output_1534491813.result
if [ $flag = 0 ]
then
break;
fi
done
echo Final Job Status:
cat output_1534491813.result | \
while read line
do
echo $line
done
rm output_1534491813.result
fi
fi
qlogout
if [ $? -ne 0 ]
then
echo Logout failed.
fi
rm $response
fi