11 changed files with 63 additions and 72 deletions
@ -1,9 +1,8 @@
@@ -1,9 +1,8 @@
|
||||
[Unit] |
||||
Description=Timer to back up the pod-charlesreid1 wiki files |
||||
Description=Timer to back up pod-charlesreid1 wiki files |
||||
|
||||
[Timer] |
||||
OnCalendar=Sun *-*-* 2:08:00 |
||||
#OnCalendar=*-*-* 2:08:00 |
||||
|
||||
[Install] |
||||
WantedBy=timers.target |
||||
|
@ -1,35 +1,36 @@
@@ -1,35 +1,36 @@
|
||||
#!/bin/bash |
||||
echo "this script is deprecated, see ../backups/wikidb_dump.sh" |
||||
## |
||||
## Dump a database to an .sql file |
||||
## from the stormy_mysql container. |
||||
#set -eu |
||||
# |
||||
# Dump a database to an .sql file |
||||
# from the stormy_mysql container. |
||||
set -x |
||||
|
||||
function usage { |
||||
echo "" |
||||
echo "dump_database.sh script:" |
||||
echo "Dump a database to an .sql file " |
||||
echo "from the stormy_mysql container." |
||||
echo "" |
||||
echo " ./dump_database.sh <sql-dump-file>" |
||||
echo "" |
||||
echo "Example:" |
||||
echo "" |
||||
echo " ./dump_database.sh /path/to/wikidb_dump.sql" |
||||
echo "" |
||||
echo "" |
||||
exit 1; |
||||
} |
||||
|
||||
CONTAINER_NAME="stormy_mysql" |
||||
|
||||
if [[ "$#" -gt 0 ]]; |
||||
then |
||||
|
||||
TARGET="$1" |
||||
mkdir -p $(dirname $TARGET) |
||||
docker exec -i ${CONTAINER_NAME} sh -c 'exec mysqldump wikidb --databases -uroot -p"$MYSQL_ROOT_PASSWORD"' > $TARGET |
||||
|
||||
else |
||||
usage |
||||
fi |
||||
|
||||
#function usage { |
||||
# echo "" |
||||
# echo "dump_database.sh script:" |
||||
# echo "Dump a database to an .sql file " |
||||
# echo "from the stormy_mysql container." |
||||
# echo "" |
||||
# echo " ./dump_database.sh <sql-dump-file>" |
||||
# echo "" |
||||
# echo "Example:" |
||||
# echo "" |
||||
# echo " ./dump_database.sh /path/to/wikidb_dump.sql" |
||||
# echo "" |
||||
# echo "" |
||||
# exit 1; |
||||
#} |
||||
# |
||||
#CONTAINER_NAME="stormy_mysql" |
||||
# |
||||
#if [[ "$#" -gt 0 ]]; |
||||
#then |
||||
# |
||||
# TARGET="$1" |
||||
# mkdir -p $(dirname $TARGET) |
||||
# set -x |
||||
# docker exec -i ${CONTAINER_NAME} sh -c 'exec mysqldump wikidb --databases -uroot -p"$MYSQL_ROOT_PASSWORD"' > $TARGET |
||||
# |
||||
#else |
||||
# usage |
||||
#fi |
||||
|
Loading…
Reference in new issue