Why isn't my backup command working?

m1ne

Well-known member
I'm trying to compress the httpdocs folder with pigz and push it to my backup drive, what is wrong?

Code:
tar cf - /var/www/vhosts/httpdocs/* | pigz -p 4 > /backup/files/HTTPDOCS-`date -I`.tar.gz
 
I have this working, but it's slooooooooow.

Code:
cd /var/www/vhosts/ && tar -pczf httpdocs-`date -I`.tar.gz httpdocs/ && mv httpdocs-`date -I`.tar.gz /backup/files/
 
don't bother with piping tar to pigz, do it separately for more reliability and speed

so tar first and then pigz the .tar file

FYI, pigz will only speed up compression compared to gzip if you have more than 1 cpu thread available
 
don't bother with piping tar to pigz, do it separately for more reliability and speed

so tar first and then pigz the .tar file

FYI, pigz will only speed up compression compared to gzip if you have more than 1 cpu thread available

I have 16 threads.
So, something like this?

Code:
cd /var/www/vhosts/ && tar -cfp httpdocs-`date -I`.tar httpdocs/ && pigz --best httpdocs-`date -I`.tar && mv httpdocs-`date -I`.tar.gz /backup/files/

Does my command look okay? I'd like for the .tar to be deleted once it is compressed, hopefully this works.
 
Last edited:
Back
Top Bottom