Skip to content

Commit 67f79f8

Browse files
committed
some minor updates
- block-volume-backup-and-restore.txt - README.md - secure.storage.sh and add parameter1.sh and functions0.sh
1 parent 5cec35a commit 67f79f8

File tree

5 files changed

+214
-6
lines changed

5 files changed

+214
-6
lines changed

cloud-infrastructure/storage/block-storage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Block Storage
22

3-
[High-performance block storage at any scale](https://www.oracle.com/cloud/storage/#rc30p1)
3+
High-performance block storage at any scale
44

55
We've designed our storage platform as an ideal complement to Oracle compute and networking services to support the highest performance requirements. OCI Block Volume uses the latest NVMe SSDs and provides nonblocking network connectivity to every host. Oracle delivers a consistent, low-latency performance of up to 225 IOPS/GB to a maximum of 300,000 IOPS and 2,680 MB/sec of throughput per volume.
66

cloud-infrastructure/storage/block-storage/asset/block-volume-backup-and-restore.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ MYoSOURCE2=/dev/sdb1
3333
DATAoDIR=/mnt/MyBlockVolume.backup-test
3434
OBJECTDATAoDIR=/mnt/MyObjectStorage.backup-test
3535
BUCKEToNAME=backup-test
36-
MYoREGION=eu-frankfurt-1
37-
MYoNAMESPACE=***
38-
MYoSECREToKEY=***
39-
MYoACCESSoKEY=***
36+
MYoREGION=<region>
37+
MYoNAMESPACE=<your_namespace>
38+
MYoSECREToKEY=<your_secret_key>
39+
MYoACCESSoKEY=<your_access_key>
4040
}----------------------------------------------------------------------------------------------
4141

4242

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
#!/bin/bash
2+
# Version: @(#).functions0.sh 1.0.0
3+
# License
4+
# Copyright (c) 2023 Oracle and/or its affiliates.
5+
# Licensed under the Universal Permissive License (UPL), Version 1.0.
6+
# See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/folder-structure/LICENSE) for more details.
7+
#
8+
#@ functions needed to run healthcheck.storage.sh
9+
#@
10+
#
11+
# Update history:
12+
#
13+
# V 1.0.0 28.06.2023 initial version
14+
#
15+
16+
17+
if [ 1 -eq 1 ] ; then # define colors
18+
Color_Off='\e[0m' # Text Reset
19+
20+
# Regular Colors
21+
Black='\e[0;30m' # Black
22+
Red='\e[0;31m' # Red
23+
Green='\e[0;32m' # Green
24+
Yellow='\e[0;33m' # Yellow
25+
Blue='\e[0;34m' # Blue
26+
Purple='\e[0;35m' # Purple
27+
Cyan='\e[0;36m' # Cyan
28+
White='\e[0;37m' # White
29+
30+
# Bold
31+
BBlack='\e[1;30m' # Black
32+
BRed='\e[1;31m' # Red
33+
BGreen='\e[1;32m' # Green
34+
BYellow='\e[1;33m' # Yellow
35+
BBlue='\e[1;34m' # Blue
36+
BPurple='\e[1;35m' # Purple
37+
BCyan='\e[1;36m' # Cyan
38+
BWhite='\e[1;37m' # White
39+
40+
# Underline
41+
UBlack='\e[4;30m' # Black
42+
URed='\e[4;31m' # Red
43+
UGreen='\e[4;32m' # Green
44+
UYellow='\e[4;33m' # Yellow
45+
UBlue='\e[4;34m' # Blue
46+
UPurple='\e[4;35m' # Purple
47+
UCyan='\e[4;36m' # Cyan
48+
UWhite='\e[4;37m' # White
49+
50+
# Background
51+
On_Black='\e[40m' # Black
52+
On_Red='\e[41m' # Red
53+
On_Green='\e[42m' # Green
54+
On_Yellow='\e[43m' # Yellow
55+
On_Blue='\e[44m' # Blue
56+
On_Purple='\e[45m' # Purple
57+
On_Cyan='\e[46m' # Cyan
58+
On_White='\e[47m' # White
59+
60+
# High Intensity
61+
IBlack='\e[0;90m' # Black
62+
IRed='\e[0;91m' # Red
63+
IGreen='\e[0;92m' # Green
64+
IYellow='\e[0;93m' # Yellow
65+
IBlue='\e[0;94m' # Blue
66+
IPurple='\e[0;95m' # Purple
67+
ICyan='\e[0;96m' # Cyan
68+
IWhite='\e[0;97m' # White
69+
70+
# Bold High Intensity
71+
BIBlack='\e[1;90m' # Black
72+
BIRed='\e[1;91m' # Red
73+
BIGreen='\e[1;92m' # Green
74+
BIYellow='\e[1;93m' # Yellow
75+
BIBlue='\e[1;94m' # Blue
76+
BIPurple='\e[1;95m' # Purple
77+
BICyan='\e[1;96m' # Cyan
78+
BIWhite='\e[1;97m' # White
79+
80+
# High Intensity backgrounds
81+
On_IBlack='\e[0;100m' # Black
82+
On_IRed='\e[0;101m' # Red
83+
On_IGreen='\e[0;102m' # Green
84+
On_IYellow='\e[0;103m' # Yellow
85+
On_IBlue='\e[0;104m' # Blue
86+
On_IPurple='\e[0;105m' # Purple
87+
On_ICyan='\e[0;106m' # Cyan
88+
On_IWhite='\e[0;107m' # White
89+
fi
90+
91+
if [ 1 -eq 1 ] ; then # set environement
92+
. parameter1.sh
93+
fi
94+
95+
if [ 1 -eq 1 ] ; then # level 0 functions (this functions do not need/call other then level 0 functions)
96+
97+
function color_print() {
98+
if [ ${DEBUG_LEVEL} -eq 0 ] ; then echo -e "$1: $2 ${Color_Off}" ; fi
99+
if [ ${DEBUG_LEVEL} -eq 1 ] ; then echo -e "$1(${DEBUG_LEVEL}) $(date "+%d.%m.%Y %H:%M:%S") : $2 ${Color_Off}" ; fi
100+
if [ ${DEBUG_LEVEL} -eq 2 ] ; then echo -e "$1(${DEBUG_LEVEL}) $(date "+%d.%m.%Y %H:%M:%S") : $2 ${Color_Off}" ; fi
101+
if [ ${DEBUG_LEVEL} -gt 2 ] ; then echo -e "$1(${DEBUG_LEVEL}) $(date "+%d.%m.%Y %H:%M:%S") : $2 ${Color_Off}" ; fi
102+
}
103+
104+
TIMESTAMP=$(date "+%Y%m%d%H%M%S") # timestamp
105+
UNIQUE_ID="k4JgHrt${TIMESTAMP}" # generate a unique ID to tag resources created by this script
106+
if [ -e /dev/urandom ];then
107+
UNIQUE_ID=$(cat /dev/urandom|LC_CTYPE=C tr -dc "[:alnum:]"|fold -w 32|head -n 1)
108+
fi
109+
TMP_FILE_LIST=() # array keeps a list of temporary files to cleanup
110+
THIS_SCRIPT="$(basename ${BASH_SOURCE})" # sciptname
111+
112+
# Do cleanup
113+
function Cleanup() {
114+
color_print "${MYcolor}" "$PF1 function: $FUNCNAME"
115+
for i in "${!TMP_FILE_LIST[@]}"; do
116+
if [ -f "${TMP_FILE_LIST[$i]}" ]; then
117+
#echo -e "deleting ${TMP_FILE_LIST[$i]}"
118+
rm -f "${TMP_FILE_LIST[$i]}"
119+
fi
120+
done
121+
}
122+
123+
# Do cleanup, display error message and exit
124+
function Interrupt() {
125+
Cleanup
126+
exitcode=99
127+
echo -e "\nScript '${THIS_SCRIPT}' aborted by user. $Color_Off"
128+
exit $exitcode
129+
}
130+
131+
# trap ctrl-c and call interrupt()
132+
trap Interrupt INT
133+
# trap exit and call cleanup()
134+
trap Cleanup EXIT
135+
136+
function tempfile()
137+
{
138+
local __resultvar=$1
139+
local __tmp_file=$(mktemp -t ${THIS_SCRIPT}_tmp_file.XXXXXXXXXXX) || {
140+
echo -e "$Cyan ......#*** Creation of ${__tmp_file} failed $Color_Off";
141+
exit 1;
142+
}
143+
TMP_FILE_LIST+=("${__tmp_file}")
144+
if [[ "$__resultvar" ]]; then
145+
eval $__resultvar="'$__tmp_file'"
146+
else
147+
echo -e "$Cyan ......#$__tmp_file"
148+
fi
149+
}
150+
151+
fi
152+
153+
# ---------------------------------------------------------------------------------------------------------------------------------------------
154+
# end of file
155+
# ---------------------------------------------------------------------------------------------------------------------------------------------
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
# Version: @(#).parameter1.sh 1.0.0
3+
# License
4+
# Copyright (c) 2023 Oracle and/or its affiliates.
5+
# Licensed under the Universal Permissive License (UPL), Version 1.0.
6+
# See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/folder-structure/LICENSE) for more details.
7+
#
8+
#@ Set needed parameter
9+
#@
10+
#
11+
# Update history:
12+
#
13+
# V 1.0.0 28.06.2023 initial version
14+
#
15+
16+
17+
18+
# ---------------------------------------------------------------------------------------------------------------------------------------------
19+
# CUSTOMER SPECIFIC VALUES - please update appropriate
20+
# ---------------------------------------------------------------------------------------------------------------------------------------------
21+
export COMPARTMENT_OCID=<your_compartment> # Compartment Name:
22+
export REGION_PROFILE=FRANKFURT # oci region profile e.g. frankfurt
23+
export CREATE_BLOCK_VOLUME=0 # create Block volume 0=no // 1=yes
24+
export CREATE_BLOCK_VOLUME_BACKUP=0 # create Block volume backup 0=no // 1=yes
25+
26+
# ---------------------------------------------------------------------------------------------------------------------------------------------
27+
# SECURITY SPECIFIC VALUES - please update appropriate
28+
# ---------------------------------------------------------------------------------------------------------------------------------------------
29+
export AD=<your_ad_number> #
30+
export AD_PREFIX=<your_prefix> # Prifix of Availability Domain
31+
export FRANKFURT_REGION_IDENTIFIER=<your_region_identifier> #
32+
export FRANKFURT_BLOCK_VOLUME_NAME=BlockVolumeFrankfurt #
33+
export FRANKFURT_AVAILABILITY_DOMAIN="${AD_PREFIX}:${FRANKFURT_REGION_IDENTIFIER}-AD-${AD}" # [AD Prefix]:[Region Identifier]-AD-[Number of Availability Domain] see https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm
34+
export VAULT_OCID=<your_vault_ocid> # Vault OCID
35+
export MasterEncryptionKey_OCID=<your_masterencryptionkey_ocid> # MasterEncryptionKey OCID
36+
37+
# ---------------------------------------------------------------------------------------------------------------------------------------------
38+
# VALUES (normally do not touch)
39+
# ---------------------------------------------------------------------------------------------------------------------------------------------
40+
export LOG_FILE=<your_log_file_name_including_the_path> #
41+
export DEBUG_LEVEL=0 # 0 (off); 1 (low); 2 (high)
42+
export PF1=### # Prefix 1 - used to introduce function
43+
export PF2="${PF1}.###:" # Prefix 2 - used to log informations inside functions
44+
export MYcolor="${IYellow}" # define output color
45+
if [ ${DEBUG_LEVEL} -eq 0 ] ; then export MYcolor=$ICyan ; fi
46+
if [ ${DEBUG_LEVEL} -eq 1 ] ; then export MYcolor=$IPurple ; fi
47+
if [ ${DEBUG_LEVEL} -eq 2 ] ; then export MYcolor=$IRed ; fi
48+
# ---------------------------------------------------------------------------------------------------------------------------------------------
49+
# end of file
50+
# ---------------------------------------------------------------------------------------------------------------------------------------------

cloud-infrastructure/storage/block-storage/asset/secure.storage.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
# ---------------------------------------------------------------------------------------------------------------------------------------------
1818
# prepare environement (load functions)
1919
# ---------------------------------------------------------------------------------------------------------------------------------------------
20-
20+
: ' ---------------------------------------------------------------------------------------------------------------------------------------
21+
To run this script, please have functions0.sh and parameter1.sh handy.
22+
Make sure parameter1.sh is set up proper with your individual variable settings.
23+
-------------------------------------------------------------------------------------------------------------------------------------------'
2124
source functions0.sh
2225

2326
# ---------------------------------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)