Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Autobackup if directory size is more than 25 MB bash

echo -e "Enter your directory: c"
read -r dirname

cal_size=$(sudo du -sm $dirname | cut -f 1)

if [ $cal_size -gt 25 ]; then
        sudo tar -cf /backup/$dirname.tar $dirname
else
        echo "Backup is not important, you can skip!"
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: Comparing float or integers in if using bash 
Shell ::  
:: powershell send message to all currently logged on users 
:: delete directory linu x 
Shell :: copy linux command with all hiden files 
::  
::  
Shell :: heroku config:set NPM_CONFIG_PRODUCTION=false YARN_PRODUCTION=false ERROR 
::  
Shell :: bash tab adds backslash before dollar sign 
Shell :: from .vendor.pip_shims.shims import InstallCommand 
:: eslint src multiple extensions 
Shell :: fslmaths fill holes 
:: vscode find all @media 
::  
Shell ::  
::  
::  
::  
::  
::  
:: Guardar cambios en una rama nueva 
::  
Shell ::  
::  
::  
Shell :: svn checkout directories recursively 
Shell :: top commiters in nepal github 
:: git edit hunk how to remove + lines 
:: how to only adda and commit file that was changed in git 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =