Apache 从Python异步执行长rsync子进程
我正在使用Python2.7、Flask和Apache编写一个简单的基于web的实用程序,它将大型文件夹从一个地方复制到另一个地方。代码对rsync执行非阻塞子进程调用,rsync将其输出记录到一个文件中:Apache 从Python异步执行长rsync子进程,apache,python-2.7,flask,subprocess,rsync,Apache,Python 2.7,Flask,Subprocess,Rsync,我正在使用Python2.7、Flask和Apache编写一个简单的基于web的实用程序,它将大型文件夹从一个地方复制到另一个地方。代码对rsync执行非阻塞子进程调用,rsync将其输出记录到一个文件中: with open(log_file, "wb") as out: subprocess.Popen(['rsync', '-vha', '--info=progress2', source, target], stdout=out, stderr=subprocess.PIPE)
with open(log_file, "wb") as out:
subprocess.Popen(['rsync', '-vha', '--info=progress2', source, target], stdout=out, stderr=subprocess.PIPE)
因此,用户发送一个请求并能够看到进度。问题是,当目录非常大(超过100GB)时,rsync在完成所有工作之前终止
所以我有两个问题:
你应该使用芹菜这样的任务队列来完成长时间运行的任务谢谢你的快速回复,我会试试的!