Tag Info

New answers tagged

1

The below script was tested on CentOS 6.5. Walks through the files under a specified folder and adds them one by one to zip file(s) no bigger than a specified max-size. Adding files to a zip one at a time can cause CPU or Storage I/O spikes: #!/bin/bash files_folder="/home/username/public_html/" zip_folder="/home/username/" zip_maxsize=524288000 # ...


0

I have found a simple solution. First I made a list of all folders I need to zip: ls > list.txt Than I removed ./ and ../ from the list. After that I have split that list with text editor into 5 different files, e.g. listPart1, listPart2, listPart3 ... I put those lists in the folder that contains all folders that need to be zipped and I ran this ...


2

Sorry I dont have a new enough cred to just comment. But something like this should help you with the zipping of the folders. #! /bin/bash DIR=$1 i=0 arr=() zipnum=0 cd $DIR for item in * do if [[ -d $item ]]; then if [ $i -lt 2 ]; then arr+=($item) ((i++)) else ...



Top 50 recent answers are included