Pauly
Active member
Having recently migrated to a new server with more resources i am trying to update a bash script that takes a file dump of all domains to utilise multi thread compression to speed things up a bit
I have moved from centos to alma9 running centminmod so carrying scripts over from there
I use pbzip2 on my sql backups which are working fine and am trying to do the same on the file backups, can anyone help me modify or replace the below to do this please
I tried replacing the tar-czf line with a few things below and cant get it to work
I have to be honest and say i dont really understand bash so hoping one of you can point me in the right direction
I have moved from centos to alma9 running centminmod so carrying scripts over from there
I use pbzip2 on my sql backups which are working fine and am trying to do the same on the file backups, can anyone help me modify or replace the below to do this please
Code:
#!/bin/bash
cd /home/nginx/domains/
for dir in *
do
base=$(basename "$dir")
if [ "$dir" == "backups" ] ; then
continue;
fi
backup_filename=$dir-`date +%F`
tar -czf /var/backups/"${backup_filename}.tar.gz" "$dir"
#echo $dir is now backed-up
done
I tried replacing the tar-czf line with a few things below and cant get it to work
Code:
pbzip2 -k /"${backup_filename}"�"$dir"
/usr/bin/pbzip2 -f /var/backups/"${backup_filename}.tar.gz" "$dir"
/usr/bin/pbzip2 -f /var/backups/*.$(/bin/date +%Y-%m-%d) "$dir"
I have to be honest and say i dont really understand bash so hoping one of you can point me in the right direction