rsync
rsync copied to clipboard
rsync command faster execution
async def run_rsync(self, source, destination): cmd = f"rsync -a --update --append-verify --inplace --progress --times --itemize-changes --out-format='%i %n %M' rsync://{source} {destination}" logging.info(f"Running command: {cmd}") process = await asyncio.create_subprocess_shell( cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
# Read output and error async
stdout, stderr = await process.communicate()
output = stdout.decode('utf-8')
error = stderr.decode('utf-8')
if process.returncode != 0:
error_message = process.stderr
logging.info(f"Rsync failed with error: {error_message}")
else:
logging.info(f"Rsync completed and delta: {output} - {datetime.now()}")
Using this command, I want to execute more faster. But currently its slow
You need to add more details and format the code using triple backticks