Add cifs support for hetzner storagebox
This commit is contained in:
parent
7d4307a154
commit
54305537a3
|
@ -22,6 +22,18 @@ fatal() { echo -e "[FATAL] $* " | logger --tag "${SCRIPTNAME}" ; exit 1 ; }
|
|||
info "Define variables"
|
||||
DATE=$(date '+%s')
|
||||
|
||||
info "Source ${HOME}/.env"
|
||||
source "${HOME}/.env"
|
||||
info "Sourced"
|
||||
|
||||
function cleanup()
|
||||
{
|
||||
sudo /usr/bin/umount ${HOME}/cifs/
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
sudo /usr/bin/mount -t cifs -o seal,user="${CIFSUSER}",pass="${CIFSPASSWD}",uid=$(id -u),gid=$(id -g),forceuid,forcegid, //"${CIFSUSER}.your-storagebox.de"/"${CIFSUSER}" ${HOME}/cifs/
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
|
@ -88,6 +100,10 @@ info "Dumping databases"
|
|||
curl --silent --retry 3 "https://cron.dryusdan.net/ping/${HC_UUID}/start" > /dev/null
|
||||
for dbname in $(/usr/bin/mysql --user=${USERNAME} --password=${PASSWORD} --host=${HOST} --port=${PORT} -N -e "show databases" | grep -v "information_schema" | grep -v "mysql" | grep -v "performance_schema")
|
||||
do
|
||||
if ! mountpoint -q -- "${FOLDER_WITHOUT_DATE}"; then
|
||||
curl --silent --retry 3 "https://cron.dryusdan.net/ping/${HC_UUID}/fail" > /dev/null
|
||||
fatal "Mountpoint not mounted"
|
||||
fi
|
||||
info "Dumping ${dbname}"
|
||||
mkdir -p ${FOLDER}/{schemas,datas}/${dbname}
|
||||
info "Dumping ${dbname} schema"
|
||||
|
@ -123,4 +139,4 @@ info "Backup is done"
|
|||
curl --silent --retry 3 "https://cron.dryusdan.net/ping/${HC_UUID}/" > /dev/null
|
||||
info "Removing old backup"
|
||||
find ${FOLDER_WITHOUT_DATE} -mtime +${RETENTION} -exec rm -rf {} \;
|
||||
info "Removing done"
|
||||
info "Removing done"
|
Loading…
Reference in New Issue