From 76bf848c4fb9415d0a4efbad8ffdb7c7bb55e10c Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Fri, 12 Sep 2014 18:47:10 +0200 Subject: [PATCH] Update paths within script files --- .gitignore | 6 +++--- Makefile | 2 +- README.md | 1 - client/usr/bin/rs-backup-run | 4 ++-- server/etc/cron.daily/rs-backup-rotate | 2 +- server/etc/cron.monthly/rs-backup-rotate | 2 +- server/etc/cron.weekly/rs-backup-rotate | 2 +- server/etc/rs-backup/rsync.conf.template | 2 +- server/usr/sbin/rs-add-ssh-key | 4 ++-- server/usr/sbin/rs-add-user | 6 +++--- server/usr/sbin/rs-rotate-cron | 2 +- server/usr/sbin/rs-update-passwd | 2 +- 12 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 029b94f..c317719 100644 --- a/.gitignore +++ b/.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 diff --git a/Makefile b/Makefile index 58b8c30..176226b 100644 --- a/Makefile +++ b/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 diff --git a/README.md b/README.md index 6eaff1d..5ba1632 100644 --- a/README.md +++ b/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 diff --git a/client/usr/bin/rs-backup-run b/client/usr/bin/rs-backup-run index 48066a4..f975d6a 100755 --- a/client/usr/bin/rs-backup-run +++ b/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="" diff --git a/server/etc/cron.daily/rs-backup-rotate b/server/etc/cron.daily/rs-backup-rotate index 7f779a0..612027a 100755 --- a/server/etc/cron.daily/rs-backup-rotate +++ b/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 diff --git a/server/etc/cron.monthly/rs-backup-rotate b/server/etc/cron.monthly/rs-backup-rotate index 85f53c0..5e4018b 100755 --- a/server/etc/cron.monthly/rs-backup-rotate +++ b/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 diff --git a/server/etc/cron.weekly/rs-backup-rotate b/server/etc/cron.weekly/rs-backup-rotate index 34de77d..4df905a 100755 --- a/server/etc/cron.weekly/rs-backup-rotate +++ b/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 diff --git a/server/etc/rs-backup/rsync.conf.template b/server/etc/rs-backup/rsync.conf.template index 32d87f2..bf098a8 100644 --- a/server/etc/rs-backup/rsync.conf.template +++ b/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} diff --git a/server/usr/sbin/rs-add-ssh-key b/server/usr/sbin/rs-add-ssh-key index f8de1e6..1a3d0e5 100755 --- a/server/usr/sbin/rs-add-ssh-key +++ b/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 diff --git a/server/usr/sbin/rs-add-user b/server/usr/sbin/rs-add-user index 477b393..8352d3e 100755 --- a/server/usr/sbin/rs-add-user +++ b/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} diff --git a/server/usr/sbin/rs-rotate-cron b/server/usr/sbin/rs-rotate-cron index 049cbbc..2613f05 100755 --- a/server/usr/sbin/rs-rotate-cron +++ b/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 diff --git a/server/usr/sbin/rs-update-passwd b/server/usr/sbin/rs-update-passwd index 70d1d7c..4b25c81 100755 --- a/server/usr/sbin/rs-update-passwd +++ b/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