Skip to content

Commit d000236

Browse files
committed
Added command to remove BAK files from container
1 parent 750a449 commit d000236

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

samples/features/sql-big-data-cluster/bootstrap-sample-db.cmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ REM Copy the backup file, restore the database, create necessary objects and dat
3838
echo Copying sales database backup file to SQL Master instance...
3939
%DEBUG% kubectl cp tpcxbb_1gb.bak mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n %CLUSTER_NAMESPACE% || goto exit
4040

41+
REM Download and copy the sample backup files
4142
if /i %AW_WWI_SAMPLES% EQU --install-extra-samples (
4243
if NOT EXIST AdventureWorks2016_EXT.bak (
4344
echo Downloading AdventureWorks2016_EXT sample database backup file...
@@ -71,6 +72,10 @@ if /i %AW_WWI_SAMPLES% EQU --install-extra-samples (
7172
echo Configuring sample database(s)...
7273
%DEBUG% sqlcmd -S %SQL_MASTER_INSTANCE% -Usa -P%SQL_MASTER_SA_PASSWORD% -i "%STARTUP_PATH%bootstrap-sample-db.sql" -o "bootstrap.out" -I -b -v SA_PASSWORD="%KNOX_PASSWORD%" || goto exit
7374

75+
REM remove files copied into the pod:
76+
echo Removing database backup files...
77+
kubectl exec mssql-master-pool-0 -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak"
78+
7479
for %%F in (web_clickstreams inventory customer) do (
7580
if NOT EXIST %%F.csv (
7681
echo Exporting %%F data...

samples/features/sql-big-data-cluster/bootstrap-sample-db.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ echo Configuring sample database...
7878
export SA_PASSWORD=$KNOX_PASSWORD
7979
$DEBUG sqlcmd -S $SQL_MASTER_INSTANCE -Usa -P$SQL_MASTER_SA_PASSWORD -I -b < "$STARTUP_PATH/bootstrap-sample-db.sql" > "bootstrap.out" || (echo $ERROR_MESSAGE && exit 2)
8080

81+
# remove files copied into the pod:
82+
echo Removing database backup files...
83+
kubectl exec mssql-master-pool-0 -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak"
84+
8185
for table in web_clickstreams inventory customer
8286
do
8387
echo Exporting $table data...

0 commit comments

Comments
 (0)