使用aria2下载时处理文件

问题描述 投票:0回答:1

我正在定期从互联网上下载zip文件夹到一个特定的文件夹,每次下载过程完成后(我使用aria2作为下载管理器)我想运行一个特定的bash脚本来处理数据。

有关如何进行的任何想法?我找到了几个引用,但我不熟悉bash脚本。顺便说一句,我正在研究Ubuntu 16.04。

例如,我有以下文件夹

enter image description here

每次下载过程完成,我想运行script.sh

bash shell directory filesystems monitoring
1个回答
1
投票

根据the documentation,aria2提供了一个名为--on-download-complete的事件钩子:

事件挂钩

aria2提供了在特定事件发生后指定任意命令的选项。目前有以下选项:--on-bt-download-complete--on-download-pause--on-download-complete--on-download-start--on-download-error--on-download-stop

所以,如果您已经提到script.sh,只需使用aria调用

aria2c --on-download-complete script.sh http://example.org/file.iso
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.