mirror of
https://github.com/YunoHost-Apps/osjs_ynh.git
synced 2024-09-03 19:56:11 +02:00
[fix] log_erase
This commit is contained in:
parent
fd575f8861
commit
5ed9244771
1 changed files with 19 additions and 0 deletions
|
@ -198,6 +198,25 @@ EOF
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
# Erase
|
||||||
|
|
||||||
|
tempus_log_erase {
|
||||||
|
cat > "/etc/cron.daily/tempus_log_erase" << EOF
|
||||||
|
#!/bin/bash
|
||||||
|
log=/var/log/$app/osjs.log
|
||||||
|
size_log=$(ls -lh $log| cut -d " " -f5 | tr -d "K" | tr -d "M")
|
||||||
|
if [ $size_log >= 1 ]
|
||||||
|
then
|
||||||
|
rm $log
|
||||||
|
touch $log
|
||||||
|
chown $app $log
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#=================================================
|
||||||
# Start or restart a service and follow its booting
|
# Start or restart a service and follow its booting
|
||||||
#
|
#
|
||||||
# usage: ynh_check_starting "Line to match" [Log file] [Timeout] [Service name]
|
# usage: ynh_check_starting "Line to match" [Log file] [Timeout] [Service name]
|
||||||
|
|
Loading…
Add table
Reference in a new issue