-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain
executable file
·73 lines (68 loc) · 2.94 KB
/
main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
str=*#*
sed -e "/$str/r school_list" -e "/$str/d" scripts/students.sql > students.sql
sed -e "/$str/r school_list" -e "/$str/d" scripts/students_data.sql > students_data.sql
sed -e "/$str/r school_list" -e "/$str/d" scripts/teachers.sql > teachers.sql
sed -e "/$str/r school_list" -e "/$str/d" scripts/teachers_data.sql > teachers_data.sql
sed -e "/$str/r school_list" -e "/$str/d" scripts/schools.sql > schools.sql
sed -e "/$str/r school_list" -e "/$str/d" scripts/schools_data.sql > schools_data.sql
echo "Exporting schools ..."
if sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/schools.sql > ~/nts/backup/schools
then
echo -e '\t\t\t\t\t\t[\e[00;32mOK\e[00m]'
else
echo -e '\t\t\t\t\t\t[\e[00;31mFAILED\e[00m]'
exit
fi
#echo "Exporting school properties ..."
#if sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/schools_data.sql > ~/nts/backup/schools_data
# then
# echo -e '\t\t\t\t\t\t[\e[00;32mOK\e[00m]'
# else
# echo -e '\t\t\t\t\t\t[\e[00;31mFAILED\e[00m]'
# exit
# fi
#---------------------
echo "Exporting teachers ..."
if sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/teachers.sql > ~/nts/backup/teachers
then
echo -e '\t\t\t\t\t\t[\e[00;32mOK\e[00m]'
else
echo -e '\t\t\t\t\t\t[\e[00;31mFAILED\e[00m]'
exit
fi
echo "Exporting teacher properties ..."
if sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/teachers_data.sql > ~/nts/backup/teachers_data
then
echo -e '\t\t\t\t\t\t[\e[00;32mOK\e[00m]'
else
echo -e '\t\t\t\t\t\t[\e[00;31mFAILED\e[00m]'
exit
fi
#-----------------------
echo "Exporting students ..."
if sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/students.sql > ~/nts/backup/students
then
echo -e '\t\t\t\t\t\t[\e[00;32mOK\e[00m]'
else
echo -e '\t\t\t\t\t\t[\e[00;31mFAILED\e[00m]'
exit
fi
echo "Exporting student properties ..."
if sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/students_data.sql > ~/nts/backup/students_data
then
echo -e '\t\t\t\t\t\t[\e[00;32mOK\e[00m]'
else
echo -e '\t\t\t\t\t\t[\e[00;31mFAILED\e[00m]'
exit
fi
#sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/schools.sql > ~/nts/backup/schools
#sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/schools_data.sql > ~/nts/backup/schools_data
#sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/teachers.sql > ~/nts/backup/teachers
#sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/teachers_data.sql > ~/nts/backup/teachers_data
#sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/students.sql > ~/nts/backup/students
#sqlplus -s schoolstat/Sch00lStat@ssdb < ~/nts/students_data.sql > ~/nts/backup/students_data
sed -i 's/###/;/g' ~/nts/backup/*
echo -e '\t\t\t\t\t\t[\e[00;32mOK\e[00m]'
cat ~/nts/backup/schools ~/nts/backup/teachers ~/nts/backup/students ~/nts/backup/teachers_data ~/nts/backup/students_data > ~/nts/backup/nobd
echo -e '\t\t\t\t\t\t[\e[00;32mOK\e[00m]'