Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

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
Comment

PREVIOUS NEXT
Code Example
Shell :: django secrets 
Shell :: sed only keep string between brackets 
Shell :: réinstaller interface graphique debian 
Shell :: pacman manager package invalid problem 
Shell :: como agregar angular material al proyecto 
Shell :: pick yarn version 
Shell :: cosmicjs 
Shell :: how to set path openssl@1.1 on mac zsh 
Shell :: zsh history by tab 
Shell :: asdf node fingerprint 
Shell :: shell Edited By King Deface 
Shell :: createing strong swan firewall centos 7 
Shell :: macos netcat write message 
Shell :: bash nb args 
Shell :: fatal authentication failed for git psuh 
Shell :: bash how to find all pdf file in subdir and copy 
Shell :: youtube-dl Network Options 
Shell :: npm view dist-tags 
Shell :: elevate current commandprompt 
Shell :: grep show line 
Shell :: check if lfs compatible 
Shell :: fixing system permission issues in ubuntu 
Shell :: ubuntu bluetooth config file 
Shell :: mirror remote branch to local repository for fixing production issues on last deployed code 
Shell :: how to change apache port in xampp 
Shell :: sed print all lines except last 
Shell :: git branch erstellen 
Shell :: Err:6 https://apt.kubernetes.io kubernetes-xenial Release 
Shell :: whatsapp is installed but not installed error in android 
Shell :: cut command in unix set diameter 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =