Technology Insights

Shell Script To Compress Many Directories Into Many Separate tar.bzip2 Files

I needed to clean up a directory on a server that included numerous directories each with numerous files inside each directory. I decided to write a quick shell script that would archive with tar and then compress with bzip2. The shell script requires you pass in a variable which could technically just be “*” to include all directories in the directory you are running the script from. Below is the content of the script followed by an explanation of each line of the script that will archive and compress numerous directories by looping through each directory to create a .tar.bzip2 file.

Technology Errors

phpMyAdmin: Script timeout passed, if you want to finish import, please resubmit same file and import will resume.

When attempting to import a gzip sql file into MySQL via phpMyAdmin I continued to get the error below. There are a couple ways to get around this issue which depend on if you have access to the server or not. Below I will describe two ways to resolve the error if you have access to the server and two ways to resolve the issue if you do not have access to the server.

Error: Script timeout passed, if you want to finish import, please resubmit same file and import will resume.