mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Added command to remove BAK files from container
This commit is contained in:
@@ -38,6 +38,7 @@ REM Copy the backup file, restore the database, create necessary objects and dat
|
||||
echo Copying sales database backup file to SQL Master instance...
|
||||
%DEBUG% kubectl cp tpcxbb_1gb.bak mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n %CLUSTER_NAMESPACE% || goto exit
|
||||
|
||||
REM Download and copy the sample backup files
|
||||
if /i %AW_WWI_SAMPLES% EQU --install-extra-samples (
|
||||
if NOT EXIST AdventureWorks2016_EXT.bak (
|
||||
echo Downloading AdventureWorks2016_EXT sample database backup file...
|
||||
@@ -71,6 +72,10 @@ if /i %AW_WWI_SAMPLES% EQU --install-extra-samples (
|
||||
echo Configuring sample database(s)...
|
||||
%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
|
||||
|
||||
REM remove files copied into the pod:
|
||||
echo Removing database backup files...
|
||||
kubectl exec mssql-master-pool-0 -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak"
|
||||
|
||||
for %%F in (web_clickstreams inventory customer) do (
|
||||
if NOT EXIST %%F.csv (
|
||||
echo Exporting %%F data...
|
||||
|
||||
@@ -78,6 +78,10 @@ echo Configuring sample database...
|
||||
export SA_PASSWORD=$KNOX_PASSWORD
|
||||
$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)
|
||||
|
||||
# remove files copied into the pod:
|
||||
echo Removing database backup files...
|
||||
kubectl exec mssql-master-pool-0 -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak"
|
||||
|
||||
for table in web_clickstreams inventory customer
|
||||
do
|
||||
echo Exporting $table data...
|
||||
|
||||
Reference in New Issue
Block a user