Fix backup row is annotated bug.

This commit is contained in:
BoHung Chiu 2022-03-19 10:56:28 +08:00
parent 69f1be5633
commit de1b4256d7
1 changed files with 5 additions and 0 deletions

View File

@ -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