diff --git a/README.MD b/README.MD index 89b6a22..a38b1d0 100644 --- a/README.MD +++ b/README.MD @@ -18,7 +18,7 @@ Script to sync music from one folder to another -t, --temp The temporary cache for converted files (default: /tmp/converted) -c, --convert Convert files to a given bitrate in kbps before syncing (default: 192) -a, --resize-art Resize album-art before syncing (default width: 200) - -j, --jobs Number of processes to use in multi-threading (default: CPU_CORES - 2) + -j, --jobs Number of processes to use in multi-threading (default: nproc - 2) -v, --verbose <0-6> Set log level (default: 2) -h, --help Display this help text diff --git a/music-sync.sh b/music-sync.sh index 597202f..cc494b2 100755 --- a/music-sync.sh +++ b/music-sync.sh @@ -13,7 +13,7 @@ #/ -t, --temp The temporary cache for converted files (default: /tmp/converted) #/ -c, --convert Convert files to a given bitrate in kbps before syncing (default: 192) #/ -a, --resize-art Resize album-art before syncing (default width: 200) -#/ -j, --jobs Number of processes to use in multi-threading (default: CPU_CORES - 2) +#/ -j, --jobs Number of processes to use in multi-threading (default: nproc - 2) #/ -v, --verbose <0-6> Set log level (default: 2) #/ -h, --help Display this help text #/ @@ -46,7 +46,7 @@ help=false temp="/tmp/converted" convertart=false coverartsize=200 -jobcount="-2" +jobcount=$(expr $(nproc) - 2) multithread=false script_name=$(basename "${0}") script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) @@ -189,12 +189,12 @@ GetOptions() { -j|--jobs) VerboseOutput 0 "--jobs given" multithread=true - jobcount="-2" + jobcount=$(expr $(nproc) - 2) if [[ $2 != "" ]]; then jobcount=${2} fi shift 2 - VerboseOutput 1 "multithreading will use ${jobcount} threads" + VerboseOutput 1 "Multithreading will use ${jobcount} threads" ;; --) shift