1
0
Fork 0
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:
frju365 2018-08-21 02:11:19 +02:00 committed by GitHub
parent fd575f8861
commit 5ed9244771
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
#
# usage: ynh_check_starting "Line to match" [Log file] [Timeout] [Service name]