Commit 72fd8978 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼 Committed by Joanne Hugé

ors-amarisoft: fix handling the previous logs

parent cee4b789
...@@ -76,7 +76,7 @@ md5sum = dab992c02a363e00cdc86f102a7ae489 ...@@ -76,7 +76,7 @@ md5sum = dab992c02a363e00cdc86f102a7ae489
[template-ue] [template-ue]
_update_hash_filename_ = instance-ue.jinja2.cfg _update_hash_filename_ = instance-ue.jinja2.cfg
md5sum = 7b9a49e6cab7d865c93148ec57d015ff md5sum = eb4c1c0e654922ded618991e5f3c0f8f
[template-obsolete] [template-obsolete]
_update_hash_filename_ = instance-obsolete.jinja2.cfg _update_hash_filename_ = instance-obsolete.jinja2.cfg
......
...@@ -62,14 +62,17 @@ log = ${:var}/log ...@@ -62,14 +62,17 @@ log = ${:var}/log
recipe = slapos.recipe.template recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_} output = ${directory:bin}/${:_buildout_section_name_}
ue-log = ${directory:log}/ue-output.log ue-log = ${directory:log}/ue-output.log
ue-radio-log = ${directory:log}/ue.log
ue-start-date = ${directory:run}/enb-start.date
inline = inline =
#!/bin/sh #!/bin/sh
{% if not slapparameter_dict.get("testing", False) %} {% if not slapparameter_dict.get("testing", False) %}
sudo /opt/amarisoft/rm-tmp-lte | true; sudo /opt/amarisoft/rm-tmp-lte | true;
sudo -n /opt/amarisoft/init-sdr; sudo -n /opt/amarisoft/init-sdr;
sudo -n /opt/amarisoft/init-ue; sudo -n /opt/amarisoft/init-ue;
stat ${:ue-log}/.ue-start-timestamp && mv ${:ue-log}/ue.log ${:ue-log}/ue-$(cat ${:ue-log}/.ue-start-timestamp).log stat ${:ue-start-date} && mv ${:ue-radio-log} ${directory:log}/ue-$(cat ${:ue-start-date}).log
date +"%Y-%m-%d-%T" > ${:ue-log}/.ue-start-timestamp rm -f $(ls -1t ${directory:log}/ue-2* | tail -n+50)
date +"%Y-%m-%d-%T" > ${:ue-start-date}
(echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting UE software..." && echo) >> ${:ue-log}; (echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting UE software..." && echo) >> ${:ue-log};
tail -c 1M ${:ue-log} > ${:ue-log}.tmp; tail -c 1M ${:ue-log} > ${:ue-log}.tmp;
mv ${:ue-log}.tmp ${:ue-log}; mv ${:ue-log}.tmp ${:ue-log};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment