diff --git a/install_orbit_environment.sh b/install_orbit_environment.sh index 6365c84..fd9483e 100644 --- a/install_orbit_environment.sh +++ b/install_orbit_environment.sh @@ -127,6 +127,11 @@ sudo sed -i 's/^\(backup\t.*\)/#\1/g' /etc/rsnapshot.conf matched_backup_home=$(grep -P "backup\t$HOME" /etc/rsnapshot.conf|xargs) if [ -z $matched_backup_home ]; then sudo sed -i "$(echo "s/^\(#backup\t\/home\/\t\)/backup\t$(echo $HOME|sed 's/\//\\\//g')\tlocalhost\/\n\1/g")" /etc/rsnapshot.conf +else + matched_backup_home=$(grep -P "(^|\s+)backup\t$HOME" /etc/rsnapshot.conf|xargs) + if [ -z $matched_backup_home ]; then + sudo sed -i "$(echo "s/[#\s\t]*backup\t$(echo $HOME|sed 's/\//\\\//g')/backup\t$(echo $HOME|sed 's/\//\\\//g')/g")" /etc/rsnapshot.conf + fi fi sudo wget -nc http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/orbit_logrotate -O /etc/logrotate.d/orbit sudo sed -i "s/rulingcom/$USER/g" /etc/logrotate.d/orbit