1、將命令寫在檔案中
資料量比較大的話,建議用程式去生成檔案,例如:
List<String> planIdList = planDao.findAll().parallelStream().map(PlanModel::getId).map(String::valueOf).collect(Collectors.toList());BufferedWriter br = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("/Users/chengjiansheng/Desktop/command.txt")));for (String planId : planIdList) { br.write("SADD PLAN_UNSYNC_S " + planId + "\r\n");}br.flush();br.close();生成的檔案可能是這樣的:

接下來,命令列執行
cat command.txt | redis-cli -h 127.0.0.1 -p 6379 -a 123456 --pipe

這個例子比較簡單,可以這么做,如果命令比較多的話可以寫成shell腳本

2、grep命令
grep "NullPointerException" access.log | wc -lgrep "com\.cjs\.babyplan\.controller\.QuestionController.*118795924" access.2019-09-17.log
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/40053.html
標籤:NoSQL
上一篇:pb code128條形碼列印
