• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Why isn't my backup command working?

Solidus

Well-known member
#1
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
 

Solidus

Well-known member
#3
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/
 

eva2000

Well-known member
#4
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
 

Solidus

Well-known member
#5
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: