diff --git a/backup.sh b/backup.sh index 9ad262e..d6be4e9 100755 --- a/backup.sh +++ b/backup.sh @@ -199,12 +199,12 @@ function svcSeafile { pidShub=$(pgrep -f "seahub") pidSeaf=$(pgrep -f seafile-controller) # force stop seahub - if [ $pidShub ]; then + if [ "$pidShub" ]; then pkill -f "seahub" exitWarn+=("[$(stamp)]_101") fi # force stop seafile - if [ $pidSeaf ]; then + if [ "$pidSeaf" ]; then pkill -f seafile-controller exitWarn+=("[$(stamp)]_101") fi @@ -733,7 +733,7 @@ if [ -z "$borgExclude" ]; then # borgExclude is empty echo -e "${info}[$(stamp)] --[INFO] Executing borg without exclusions --" \ "${normal}" >> "$logFile" - borg --show-rc create ${borgCreateParams} ::`date +%Y-%m-%d_%H%M%S` \ + borg --show-rc create ${borgCreateParams} ::"$(date +%Y-%m-%d_%H%M%S)" \ "${xtraFiles[@]}" \ "${sqlDumpDir}" "${dataDir}" \ 2>> "$logFile" @@ -742,7 +742,7 @@ else echo -e "${info}[$(stamp)] --[INFO] Executing borg with exclusions --" \ "${normal}" >> "$logFile" borg --show-rc create ${borgCreateParams} --exclude-from "${borgExclude}" \ - ::`date +%Y-%m-%d_%H%M%S` \ + ::"$(date +%Y-%m-%d_%H%M%S)" \ "${xtraFiles[@]}" \ "${sqlDumpDir}" "${dataDir}" \ 2>> "$logFile"