Skip to content

Commit 9e12fe6

Browse files
committed
Speed up BACKUP_LA_LIMIT check
grep -c '^processor' /proc/cpuinfo vs cat /proc/cpuinfo | grep '^processor' | wc -l is about 20 times faster ...
1 parent 114bf4b commit 9e12fe6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

func/main.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ HOMEDIR='/home'
3535
BACKUP='/backup'
3636
BACKUP_GZIP=9
3737
BACKUP_DISK_LIMIT=95
38-
BACKUP_LA_LIMIT=$(cat /proc/cpuinfo | grep '^processor' | wc -l)
38+
BACKUP_LA_LIMIT=$(time grep -c '^processor' /proc/cpuinfo)
3939
RRD_STEP=300
4040
BIN=$HESTIA/bin
4141
HESTIA_INSTALL_DIR="$HESTIA/install/deb"

0 commit comments

Comments
 (0)