Skip to navigation
Bash-script what unzip a mssql backup file and rename it
16.06.16
#!/bin/bash BAK_DIR="/mnt/sql_backup/SBVM682-SQL01/SL/" TMP_DIR="/mnt/sql_backup/tmp_sql/" cd $BAK_DIR FILE=$(ls -t | awk '{printf("%s",$0);exit}') FILE_PATH=$BAK_DIR$FILE TMP_PATH=$TMP_DIR$FILE TMP_PATH="${TMP_PATH/zip/bak}" NEW_TMP_PATH=$TMP_DIR NEW_TMP_PATH+='sl.bak' unzip $FILE_PATH -d "$TMP_DIR" mv $TMP_PATH $NEW_TMP_PATH
https://linuxconfig.org/bash-scripting-tutorial
Reply
Anonymous
Information Epoch 1732620824
Silence is golden.
Home
Notebook
Contact us