]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Merging
authorwbudic <redacted>
Thu, 7 Mar 2019 01:41:12 +0000 (12:41 +1100)
committerwbudic <redacted>
Thu, 7 Mar 2019 01:41:12 +0000 (12:41 +1100)
README.md
backupDBLifeLog.sh [new file with mode: 0755]
startDevWebServer.sh

index 9627fbb5fde402aa7383f9db80ab74eba832d0ed..241a1b16a33acec0dd97a66fa02d9e8b4edd5742 100644 (file)
--- a/README.md
+++ b/README.md
@@ -3,4 +3,6 @@
 Application that keeps an everyday web CGI accessible log of database entries of various categories.
 Written in perl, easy to implement and modify.
 
-## Warning - This application is currently onder development, since Aug, 2018
+## This application is currently onder development at the source code head, since Aug, 2018.
+#Current usable is release-1.0.
+
diff --git a/backupDBLifeLog.sh b/backupDBLifeLog.sh
new file mode 100755 (executable)
index 0000000..8686b9e
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# Following is an hardcoded script that can be used on your local machine
+# to archive from server all the latest SQLite databases on the DB Life Log server.
+#
+# Usefull to cron, to auto backup the databases just in case.
+#
+# Programed by: Will Budic
+# Open Source License -> https://choosealicense.com/licenses/isc/
+
+#Example crontab -e entry for every three hours.
+# crontab -> * */3 * * * ./backupDBLifeLog.sh > /dev/null 2>&1
+
+
+
+DIR="/home/will/Documents/dbLifeLog"
+NOW=`date +%Y%m%d`
+
+if [ ! -d "$DIR" ]; then
+   mkdir $DIR
+fi
+cd $DIR
+
+sftp will@nuc:/home/will/thttpd_dev/dbLifeLog/ <<EOF
+get *.db 
+exit
+EOF
+
+#
+# Archiving optional bellow.
+#
+
+tar -czvf DB_LIFE_LOG_BACKUP_$NOW.tar *.db
+
+#Remove unecessary files.
+find $DIR -type f -name '*.tar' -mtime  1 -exec rm {} \; 
+rm *.db
+
+
+exit
index dde9c0e0f95c7498a4657291ef68635abbbe3486..411b1db3c2bfe3ef36d7ae66218747600c665dc7 100755 (executable)
@@ -1 +1,4 @@
-thttpd -C thttpd.conf&
+
+export DB_USER="db"
+export DB_PASS="db_pass"
+thttpd -C thttpd.conf&