Linux

Linux Bash Script To ZIP contents of Folders

backup.sh #sets the current date and time to a variable so it can be used when naming zip filecurrent_time=$(date ā€œ+%Y-%m-%d_%H.%M.%Sā€) #compress contents of /var folder to zip file tar -zcvf /mnt/EXTHD01/fedora01/backup/fedora01_$current_time.tar.gz /var…