Browse Source

Update paths within script files

master
Janek Bevendorff 7 years ago
parent
commit
76bf848c4f
  1. 6
      .gitignore
  2. 2
      Makefile
  3. 1
      README.md
  4. 4
      client/usr/bin/rs-backup-run
  5. 2
      server/etc/cron.daily/rs-backup-rotate
  6. 2
      server/etc/cron.monthly/rs-backup-rotate
  7. 2
      server/etc/cron.weekly/rs-backup-rotate
  8. 2
      server/etc/rs-backup/rsync.conf.template
  9. 4
      server/usr/sbin/rs-add-ssh-key
  10. 6
      server/usr/sbin/rs-add-user
  11. 2
      server/usr/sbin/rs-rotate-cron
  12. 2
      server/usr/sbin/rs-update-passwd

6
.gitignore

@ -6,6 +6,6 @@ desktop.ini
Desktop.ini
.DS_Store
server/usr/local/etc/rs-backup/server-config
client/usr/local/etc/rs-backup/client-config
client/usr/local/etc/rs-backup/include-files
server/etc/rs-backup/server-config
client/etc/rs-backup/client-config
client/etc/rs-backup/include-files

2
Makefile

@ -23,7 +23,7 @@ server-install: $(wildcard server/bkp/etc/*) $(wildcard server/etc/*/*) $(wildca
mkdir -p /etc/rs-skel
mkdir -p /etc/rs-backup
mkdir -p /bkp/{bin,dev,etc,lib,usr}
mkdir -p /bkp/usr/{bin,lib,local,share}
mkdir -p /bkp/usr/{bin,lib,share}
ifeq ($(OS),Ubuntu)
mkdir -p /bkp/usr/share/perl

1
README.md

@ -52,7 +52,6 @@ rs-backup-suite can chroot backup users into the backup home base directory. For
/lib /bkp/lib none bind 0 0
/usr/bin /bkp/usr/bin none bind 0 0
/usr/lib /bkp/usr/lib none bind 0 0
/usr/local/bin /bkp/usr/local/bin none bind 0 0
/usr/share/perl5 /bkp/usr/share/perl5 none bind 0 0
/dev /bkp/dev none bind 0 0

4
client/usr/bin/rs-backup-run

@ -14,7 +14,7 @@
# Source configs
###############################################################################
. /usr/local/etc/rs-backup/client-config
. /etc/rs-backup/client-config
###############################################################################
@ -22,7 +22,7 @@
###############################################################################
_VERSION=0.1.1
_GLOBAL_INCLUSION_PATTERN_FILE="/usr/local/etc/rs-backup/include-files"
_GLOBAL_INCLUSION_PATTERN_FILE="/etc/rs-backup/include-files"
_FORCED_INCLUSION_PATTERN_FILE=""
_SKIP_HOME_DIRS=false
_FORCED_LOG_FILE=""

2
server/etc/cron.daily/rs-backup-rotate

@ -1,2 +1,2 @@
#!/bin/sh
/usr/local/sbin/rs-rotate-cron daily
/usr/sbin/rs-rotate-cron daily

2
server/etc/cron.monthly/rs-backup-rotate

@ -1,2 +1,2 @@
#!/bin/sh
/usr/local/sbin/rs-rotate-cron monthly
/usr/sbin/rs-rotate-cron monthly

2
server/etc/cron.weekly/rs-backup-rotate

@ -1,2 +1,2 @@
#!/bin/sh
/usr/local/sbin/rs-rotate-cron weekly
/usr/sbin/rs-rotate-cron weekly

2
server/etc/rs-backup/rsync.conf.template

@ -8,7 +8,7 @@ log file = ${HOME_DIR}/rsync.log
fake super = 1
max connections = 1
lock file = ${HOME_DIR}/rsyncd.lock
post-xfer exec = touch "${HOME_DIR}/${FILES_DIR}/.sync" && /usr/local/bin/rs-rotate "${HOME_DIR}/rsnapshot.conf"
post-xfer exec = touch "${HOME_DIR}/${FILES_DIR}/.sync" && /usr/bin/rs-rotate "${HOME_DIR}/rsnapshot.conf"
[pull]
uid = ${USERNAME}

4
server/usr/sbin/rs-add-ssh-key

@ -12,14 +12,14 @@ if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ]; then
exit
fi
. /usr/local/etc/rs-backup/server-config
. /etc/rs-backup/server-config
home_dir="${BACKUP_ROOT}/${1}-${2}"
mkdir -p "${home_dir}/.ssh"
# Add public key to authorized_keys file and restrict shell commands
echo -n "command=\"/usr/local/bin/rs-run-ssh-cmd '${home_dir}'\" " >> "${home_dir}/.ssh/authorized_keys"
echo -n "command=\"/usr/bin/rs-run-ssh-cmd '${home_dir}'\" " >> "${home_dir}/.ssh/authorized_keys"
cat "$3" >> "${home_dir}/.ssh/authorized_keys"
# Protect SSH config by assigning ownership to root

6
server/usr/sbin/rs-add-user

@ -12,7 +12,7 @@ if [ "$1" == "" ] || [ "$2" == "" ]; then
exit
fi
. /usr/local/etc/rs-backup/server-config
. /etc/rs-backup/server-config
remote_hostname="$1"
remote_username="$2"
@ -27,8 +27,8 @@ USERNAME="${local_username}"
GROUPNAME="${local_username}"
HOME_DIR="${BACKUP_ROOT}/${local_username}"
rsync_conf="$(cat /usr/local/etc/rs-backup/rsync.conf.template)"
rsnapshot_conf="$(cat /usr/local/etc/rs-backup/rsnapshot.conf.template)"
rsync_conf="$(cat /etc/rs-backup/rsync.conf.template)"
rsnapshot_conf="$(cat /etc/rs-backup/rsnapshot.conf.template)"
rsync_conf=$(eval "cat << EOF
${rsync_conf}

2
server/usr/sbin/rs-rotate-cron

@ -6,7 +6,7 @@ if [ "$1" == "" ]; then
exit
fi
. /usr/local/etc/rs-backup/server-config
. /etc/rs-backup/server-config
for home_dir in "${BACKUP_ROOT}"/*; do
if [ -d "${home_dir}/${FILES_DIR}" ] && [ -e "${home_dir}/rsnapshot.conf" ]; then

2
server/usr/sbin/rs-update-passwd

@ -1,6 +1,6 @@
#!/bin/bash
. /usr/local/etc/rs-backup/server-config
. /etc/rs-backup/server-config
# Take precautions :-)
if [ "${BACKUP_ROOT}" == "" ] || [ "$(realpath ${BACKUP_ROOT})" == "/" ]; then

Loading…
Cancel
Save