Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsync command faster execution #689

Open
kmuthugtk opened this issue Jan 7, 2025 · 0 comments
Open

rsync command faster execution #689

kmuthugtk opened this issue Jan 7, 2025 · 0 comments

Comments

@kmuthugtk
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant