Last active
April 21, 2017 08:59
-
-
Save dobrivoje/f6ead0d9efc91c6d62739d5a91a8e5ca to your computer and use it in GitHub Desktop.
Linux - Multi cpu compression of (large) postgresql database backup(s)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################### | |
# fast compression of the big postgresql backup file # | |
# we'll take advantage of the multi processor machine # | |
# to speedup compression process ! # | |
# # | |
# reqirement : apt-get install pigz (ubuntu/debian like) # | |
########################################################### | |
# input parameter1 = <entire folder to compress> | |
# input parameter2 = $CPU_NO | |
# output parameter = <archive name>.tar.gz - file which will be created | |
tar -cf <entire folder to compress> | pigz -9 -p <$CPU_NO> > <archive name>.tar.gz | |
# example : | |
# tar -cf /tmp/db-public.23122015.backup | pigz -9 -p 16 > /ssd/backups/archives/db-public.23122015.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment