BackupPC – Enabling Compression
I’ve been running BackupPC as a backup solution at my work for quite some time now and realized that compression wasn’t enabled by default. To enable it, you need to modify /etc/backuppc/config.pl and change the line…
$Conf{CompressLevel} = 0;
…to any number between 0 (no compression) and 9 (highest compression). Be careful not to set it too high as the higher you go, the more CPU time it requires. Restart BackupPC service either through the web console or by restarting through “/etc/init.d/backuppc restart”. The next time a backup job runs for your hosts, it will run with the compression level you chose.
Here’s an excerpt from BackupPC’s documentation regarding enabling compression:
“Changing compression on or off after backups have already been done will require both compressed and uncompressed pool files to be stored. This will increase the pool storage requirements, at least until all the old backups expire and are deleted.
It is ok to change the compression value (from one non-zero value to another non-zero value) after dumps are already done. Since BackupPC matches pool files by comparing the uncompressed versions, it will still correctly match new incoming files against existing pool files. The new compression level will take effect only for new files that are newly compressed and added to the pool.
If compression was off and you are enabling compression for the first time you can use the BackupPC_compressPool utility to compress the pool. This avoids having the pool grow to accommodate both compressed and uncompressed backups.”
Unfortunately for me, I had to compress my existing pool of a little over 4TB before I could run any new compressed backup jobs. I didn’t have the space to retain both uncompressed and compressed pools. It took close to 200 hours to compress the entire pool, but it was well worth the wait. I had gone from having 300GB to 1.3TB of free space after it was all done.
One last note: compression needs the Compress::Zlib perl library. If the Compress::Zlib library can’t be found then $Conf{CompressLevel} is forced to 0 (compression off).
March 21, 2009 at 8:58 pm
Hi,
Frienc I want to know that how to configure BackupPC can you please tell me procedure step by step. I Tried lots of Tutorial but no one helps ….
So please can you tell me how to configure it???????
Thanks in Advance Please helps its urgent.
March 21, 2009 at 10:59 pm
Hi Amit:
I used the tutorial from HowToForge. It worked quite well for me. Here’s the link: http://www.howtoforge.com/linux_backuppc
I’m still using v2.1.2 of BackupPC from the tutorial and haven’t yet upgraded to v3.1.0. I didn’t see the need to in my case. Just follow the tutorial step by step. Let me know if you need additional help.
Cheers,
quefyx
March 23, 2009 at 3:05 am
Thanks for your Reply.
But I already tried that and nothing worked for me every time i am getting error is “unable to read 4 bytes”. If you me favour and if you can send your config.pl and everyfile which is related to BackupPC then its really grateful to you
Thanks
March 23, 2009 at 9:10 am
Amit:
I just emailed you my configurations. Hope that helps. Let me know if you need anything else.
Cheers,
quefyx
April 21, 2009 at 3:49 am
Amit
The error you are suffering is usually related with communications problems between the BackupPC server and the machine to be backup.
Check that the BackupPC user in the BackupPC server can connect using ssh with the machine to be backup wihout using a password (you have to interchange certificates between the two machines in order this to work).