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 :: grep -R exlude directory 
Shell :: psycopg2 not installing on python-alpine 
Shell :: save vscode account details linux 
Shell :: rename file with terminal 
Shell :: ubuntu fresh install deps 
Shell :: Continuous bash script to do tasks 
Shell :: getting help for git 
Shell :: How to search within a file when displayed with less program 
Shell :: install openvino for ubuntu 20 
Shell :: passwd password for aibotuser is unchanged docker 
Shell :: guardar vi 
Shell :: smach viewer usage 
Shell :: see prerouting rules linux 
Shell :: Vegeta CLI 
Shell :: How can I make ubuntu--vg-ubuntu--lv consume the entire disk space available? 
Shell :: Linux UTF-8 
Shell :: The zip extension must be loaded 
Shell :: best ubuntu torrent downloader 
Shell :: Error: Error: rpmdb open failed 
Shell :: nohup server stop in python django 
Shell :: rails scaffold no views 
Shell :: sort specific extension by date 
Shell :: ring check if the operating system is Unix or not 
Shell :: ssh to gcp vm 
Shell :: drop-in 
Shell :: bash .inputrc color tab completion and more 
Shell :: turbo top for linux 
Shell :: cf7 use shortcode title 
Shell :: bat to delete all ".trashed" files in subfolders 
Shell :: unix edit timestamp file: Copy the Time-stamp from Another File 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =