Horje
shell script to set a max size of log file (laravel) Code Example
shell script to set a max size of log file (laravel)
!#/bin/bash

file = /home/user/myapp.com/storage/logs/laravel.log # log file path
maxSize = 2048 #2MB - size in kilobytes
fileSize = $(du -k "$file" | cut -f 1)

if [ $fileSize -ge $maxSize]; then
    echo "" > $file
fi




Shell

Related
terminal trash folder Code Example terminal trash folder Code Example
git push origin deatched hhead Code Example git push origin deatched hhead Code Example
how to perform an action for each line in bash Code Example how to perform an action for each line in bash Code Example
testing stripe webhooks for gitpod Code Example testing stripe webhooks for gitpod Code Example
docker daemon.json permission denied Code Example docker daemon.json permission denied Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9