docker日志分割
#!/bin/sh echo "===start collect docker containers logs ====" logfile=/home/xxx/app/logs/prod`date -d "-1 day" +%Y%m%d`.log logs=$(find /home/xxx/.local/share/containers/storage/ -name ctr.log) for log in $logs; do echo "collect logs:" echo $logfile cat $log>$logfile cat /dev/null > $log echo "logs cleared." done echo "===end collect docker containers logs ==="
unity中的简单延时方法
1.使用invoke Invoke("changeOne", 2f); private void changeOne() { skin.material.color = Color.yellow; //材质变为黄色 } 2. 使用协程 StartCoroutine("changeSkin"); //开始协程 IEnumerator changeSkin() //协程方法 { yield return new WaitForSeconds(2f); //暂停协程,2秒后执行之后的操作 skin.material.color = Color.green; }