Edit README.md, add instructions for special files. Flesh out special dump functions.
parent
5070c5c3f0
commit
6d96fb5edb
21
README.md
21
README.md
|
|
@ -15,6 +15,27 @@ Ensure restrictive permissions on this file as it exposes the passphrase.
|
|||
|
||||
chown root. 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
|
||||
## systemd
|
||||
|
|
|
|||
|
|
@ -31,6 +31,42 @@ error_handler () {
|
|||
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 () {
|
||||
if [[ -z ${BORG_INIT_ARGS[@]} ]]; then
|
||||
BORG_INIT_ARGS=(
|
||||
|
|
|
|||
|
|
@ -7,7 +7,10 @@ BORG_REPO="<user>@<reposerver>:/srv/borg/${SYSTEM_NAME}"
|
|||
#BORG_REPO="ssh://<user>@<reposerver>:<ssh_port>/srv/borg/${SYSTEM_NAME}"
|
||||
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=""
|
||||
MONGODB_ROOT_PASSWORD=""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue