I want to run the following Bash command in Python:
import subprocess
command = 'tar -vcz -C /mnt/20TB_raid1 Illumina_Sequencing_Data | pigz | tee >(md5sum > "md5sum_Illumina_Sequencing_Data.txt") | split -b 50G - /mnt/4TB_SSD/Illumina_Sequencing_Data.tar.gz.part-'
subprocess.run(command.split(" "))
When I run this code I get the following error:
tar: 50G: Invalid blocking factor
Try 'tar --help' or 'tar --usage' for more information.
However, when I run this command in the shell directly it run without any issues. It looks like some code is ignored as it thinks the split
-b flag is parsed to tar?