Skip to content

Commit c0b30ea

Browse files
DavidDamkeDeath111
andauthored
Update exportScriptForLinux/createBackupForLinux.sh
Works on Linux Ubuntu 22.04.1 LTS Co-authored-by: Nico <[email protected]>
1 parent f6bdc30 commit c0b30ea

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

exportScriptForLinux/createBackupForLinux.sh

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,22 @@ DB_USER=sa
55
DB_PASSWD=
66
SQL_BACKUP_FILENAME=KeepTime_database-export_H2-version-$H2_VERSION.sql
77

8-
echo Get H2 jar from KeepTime jar ....
9-
jar xf keeptime-1.2.0-SNAPSHOT.jar
10-
rm -r org
11-
rm -r META-INF
12-
echo
8+
echo "Script to export the content of H2 databse from KeepTime version 1.2.0-SNAPSHOT to .sql file."
9+
echo "The script should be placed next to the .jar file."
10+
read -p "Press enter to continue"
1311

12+
echo -e "\nExtracting H2 driver from KeepTime .jar file."
1413
DRIVER_JAR_FROM_KEEPTIME=BOOT-INF/lib/h2-$H2_VERSION.jar
14+
jar xfv keeptime-1.2.0-SNAPSHOT.jar $DRIVER_JAR_FROM_KEEPTIME
1515

16-
echo Filename : $SQL_BACKUP_FILENAME
17-
echo
18-
echo Location :
19-
pwd
20-
echo
16+
echo -e "\nTriggering database backup."
17+
java -cp $DRIVER_JAR_FROM_KEEPTIME org.h2.tools.Script -url $DB_URL -user $DB_USER -script $SQL_BACKUP_FILENAME -options DROP
2118

22-
23-
java -cp $DRIVER_JAR_FROM_KEEPTIME org.h2.tools.Script -url $DB_URL -user $DB_USER -script $SQL_BACKUP_FILENAME -options DROP
24-
rm -r BOOT-INF
19+
echo -e "\nCleanup of extracted .jar file."
20+
rm -rv BOOT-INF
2521

26-
echo delete Files from unzipping KeepTime
27-
echo Export succeeded
22+
echo -e "\nIf no error occured the export has succeeded."
23+
echo "The exported file was created at '$(pwd)/$SQL_BACKUP_FILENAME'."
24+
echo -e "\nYou can now import this file in a new version of KeepTime.\n"
25+
26+
read -p "All set. Press enter to exit script."

0 commit comments

Comments
 (0)