fixes for user rights

This commit is contained in:
olli 2022-12-05 17:36:17 +01:00
parent 96231548a4
commit 7309a72e9c

View File

@ -56,7 +56,8 @@ function g_backup {
ORIGIFS="$IFS" ORIGIFS="$IFS"
IFS=':' IFS=':'
# Prepare Dest-Dir on Backup-Server # Prepare Dest-Dir on Backup-Server
CMDS="mkdir -p ${BACKUPSRVPATH}:chmod 700 ${BACKUPSRVPATH}" CMDS="mkdir -p ${BACKUPSRVPATH}/$(hostname):chmod 700 ${BACKUPSRVPATH}/$(hostname)"
[ -n "$NODIRSTRUCT" ] && CMDS="mkdir -p ${BACKUPSRVPATH}:chmod 700 ${BACKUPSRVPATH}"
[ -n "$BACKUPSRVTESTCMD" ] && CMDS="$BACKUPSRVTESTCMD:$CMDS" [ -n "$BACKUPSRVTESTCMD" ] && CMDS="$BACKUPSRVTESTCMD:$CMDS"
for CMD in $CMDS for CMD in $CMDS
do do
@ -101,7 +102,7 @@ $(cat $g_tmp/bcmd)"
# Cleanup old backups # Cleanup old backups
yearmonth="$(date +%Y-%m-)" yearmonth="$(date +%Y-%m-)"
yearmonthbefore="$(date +%Y-%m- --date='-1 month')" yearmonthbefore="$(date +%Y-%m- --date='-1 month')"
echo "$sshopts find $BACKUPSRVPATH_WITH_HOST -mindepth 1 -maxdepth 1 -type d -name \"backup-*\" | egrep -v \"backup-$yearmonth|backup-$yearmonthbefore|backup-20[0-9][0-9]-[0-9][0-9]-01\" | xargs -r rm -r" >>$g_tmp/bcmd echo "$sshopts find $BACKUPSRVPATH_WITH_HOST -mindepth 1 -maxdepth 1 -type d -name \"backup-*\" | egrep -v \"backup-$yearmonth|backup-$yearmonthbefore|backup-20[0-9][0-9]-[0-9][0-9]-01\" | xargs -r rm -r" >$g_tmp/bcmd
g_echo "Cleaning up Backupdir $BACKUPDIR with '$(cat $g_tmp/bcmd)'" g_echo "Cleaning up Backupdir $BACKUPDIR with '$(cat $g_tmp/bcmd)'"
g_runcmd bash $g_tmp/bcmd || exit $? g_runcmd bash $g_tmp/bcmd || exit $?