Edit README.md, add instructions for special files. Flesh out special dump functions.

dev
Bryan 2020-09-20 00:26:50 -06:00
parent 5070c5c3f0
commit 6d96fb5edb
3 changed files with 61 additions and 1 deletions

View File

@ -15,6 +15,27 @@ Ensure restrictive permissions on this file as it exposes the passphrase.
chown root. config chown root. config
chmod 600 config chmod 600 config
## Special files
To be able to dump special files there are a few things that need to be done.
### Installed package list
Must have the package **apt-mark** installed.
### MySql Dump
Must have the package **mysqldump** installed.
Must have `.my.cnf` configuration file in `/root` directory.
Create `.my.cnf` in `/root` directory:
[mysql]
user="root"
password="mysql-root-password"
[mysqldump]
user="root"
password="mysql-root-password"
Change permissions of `.my.conf`:
chmod 600 /root/.my.conf
# Scheduling # Scheduling
## systemd ## systemd

View File

@ -31,6 +31,42 @@ error_handler () {
exit ${EXIT_CODE} exit ${EXIT_CODE}
} }
save_package_list () {
if ! which apt-mark; then
return 2
fi
if [ ! -d dirname "${PACKAGE_LIST_FILE}" ]; then
mkdir -p dirname "${PACKAGE_LIST_FILE}"
fi
apt-mark showmanual > ${PACKAGE_LIST_FILE}
}
dump_sql () {
if ! which mysqldump; then
return 2
fi
if [ ! -d dirname "${MYSQL_DUMP_FILE}" ]
then mkdir -p dirname "{$MYSQL_DUMP_FILE}"
fi
}
dump_mongo () {
if ! which mongodump; then
return 2
fi
if [ ! -d dirname "${MONGODB_DUMP_FILE}" ]
then mkdir -p dirname "{$MONGODB_DUMP_FILE}"
fi
}
borg_init () { borg_init () {
if [[ -z ${BORG_INIT_ARGS[@]} ]]; then if [[ -z ${BORG_INIT_ARGS[@]} ]]; then
BORG_INIT_ARGS=( BORG_INIT_ARGS=(

View File

@ -7,7 +7,10 @@ BORG_REPO="<user>@<reposerver>:/srv/borg/${SYSTEM_NAME}"
#BORG_REPO="ssh://<user>@<reposerver>:<ssh_port>/srv/borg/${SYSTEM_NAME}" #BORG_REPO="ssh://<user>@<reposerver>:<ssh_port>/srv/borg/${SYSTEM_NAME}"
BORG_PASSPHRASE="longandcomplexpassphrase" BORG_PASSPHRASE="longandcomplexpassphrase"
DUMP_DIR="/srv/dumps" PACKAGE_LIST_FILE="/srv/dumps/package-list.txt"
MYSQL_DUMP_FILE="/srv/dumps/mysql-dump.sql.bak"
MONGODB_DUMP_FILE="/srv/dumps/mongodb-dump.bak"
MYSQL_ROOT_PASSWORD="" MYSQL_ROOT_PASSWORD=""
MONGODB_ROOT_PASSWORD="" MONGODB_ROOT_PASSWORD=""