Lzop use to be my favorite fast compression program. That is until I learned about parallels gzip (pigz)
enter image description here

Compress a Folder

# compress a folder called "myfolder" at maximum compression using six threads
tar cf - myfolder | pigz -9 -p 6 > myfolder.tar.gz

Compress a Folder (Using Variables):

# compress a folder called "/myfolder" at maximum compression using six threads
FOLDER-NAME=/myfolder
COMPRESSION-LEVEL=9
THREADS=6
tar cf - ${FOLDER-NAME} | pigz -${COMPRESSION-LEVEL} -p ${THREADS} > ${FOLDER-NAME}.tar.gz

Backup Mysql and Compress Output

BACKUP_DEST="/backup/backups"
OSSIM_VERSION=$(dpkg -l | grep ossim-cd-tools | awk '{print $3}' | awk -F'-' '{ print $1 }')
OSSIM_HOSTNAME=$(cat /etc/hostname)
OSSIM_MYSQLPW=$(grep ^pass /etc/ossim/ossim_setup.conf | sed 's/pass=//')
TIMESTAMP_NOW=$(date "+%Y-%m-%d--%H-%M")

cd ${BACKUP_PATH}
mysqldump -p${OSSIM_MYSQLPW} \
--no-autocommit \
--single-transaction \
--all-databases \
| pigz > ${BACKUP_PATH}/${TIMESTAMP_NOW}-${OSSIM_HOSTNAME}-OSSIM_${OSSIM_VERSION}-alienvault-mysql-all-dbs.sql.gz
Last modified: March 12, 2019

Author

Comments

Write a Reply or Comment

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

This site uses Akismet to reduce spam. Learn how your comment data is processed.