Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
fix error message if less than 5 backups exist
  • Loading branch information
SgtBatten authored and taniman committed Feb 10, 2019
1 parent e5038c0 commit 844452a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,9 @@ if [ -n "${1}" ]; then
fi

### Remove all but the 5 most recent backups ###
ls -dt "$DIR"/updatescript/*/ | tail -n +6 | xargs rm -r
if [ "$(ls -ld $DIR/updatescript/* | wc -l)" -gt 5 ]
then
ls -dt "$DIR"/updatescript/*/ | tail -n +6 | xargs rm -r
echo "Removed old backups from updatescript folder."
fi

0 comments on commit 844452a

Please sign in to comment.