From 0d00dd91da0278746fad0f612444799c406d510a Mon Sep 17 00:00:00 2001 From: nojhan Date: Sat, 3 Mar 2018 14:41:37 +0100 Subject: [PATCH] bugfixes rsnapshot/anacron --- rsnapshot_anacron/install.sh | 16 +++++++--------- rsnapshot_anacron/rsnapshot_common | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) mode change 100644 => 100755 rsnapshot_anacron/install.sh diff --git a/rsnapshot_anacron/install.sh b/rsnapshot_anacron/install.sh old mode 100644 new mode 100755 index a544c33..17d2b36 --- a/rsnapshot_anacron/install.sh +++ b/rsnapshot_anacron/install.sh @@ -7,21 +7,21 @@ set -euo pipefail user="$USER" -mkdir -p $user/scripts -cp -r ../anacron $user/scripts/ -cd $user/scripts/ +mkdir -p $HOME/scripts +cp -r ../rsnapshot_anacron $HOME/scripts/ +cd $HOME/scripts/rsnapshot_anacron/ base="$(pwd)" # Check installed packages installed="$(dpkg -l rsnapshot)|grep '^ii\srsnapshot\s'" -if [[ "$sintalled" == "" ]]; then +if [[ "$installed" == "" ]]; then echo "rsnapshot is not installed" echo "You should install it and edit /etc/rsnapshot.conf:" echo "sudo apt install rsnapshot anacron && sudo gvim /etc/rsnapshot.conf" exit 100 fi -sudo install anacron +sudo apt install anacron snapshot=$(grep "^snapshot_root.*$" /etc/rsnapshot.conf|cut -f 2) @@ -33,7 +33,7 @@ fi tag="=^=rsnapshot_anacron=^=" if [[ $(grep "$tag" /etc/anacrontab) == "" ]]; then -sudo echo " +echo " ########################################################## # $tag # périodicité (jours), @@ -44,11 +44,9 @@ sudo echo " @daily 10 backup.daily sudo -u $user run-parts $base/daily/ @weekly 10 backup.weekly sudo -u $user run-parts $base/weekly/ @monthly 10 backup.monthly sudo -u $user run-parts $base/monthly/ -" >> /etc/anacrontab +" | sudo tee -a /etc/anacrontab fi -ln -s $base ~/.anacron - # Test if snapshot dir is set source $base/rsnapshot_common if [[ "$SNAPSHOT_ROOT" == "" ]] ; then diff --git a/rsnapshot_anacron/rsnapshot_common b/rsnapshot_anacron/rsnapshot_common index e82ee9f..48237df 100644 --- a/rsnapshot_anacron/rsnapshot_common +++ b/rsnapshot_anacron/rsnapshot_common @@ -19,7 +19,7 @@ ENABLE_CRON=no # SNAPSHOT_ROOT="" -RSNAPSHOT="/usr/bin/rsnapshot -t" +RSNAPSHOT="/usr/bin/rsnapshot" function backup() {