使用 aria2 下载时处理文件

Process files while downloading with aria2

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

知道如何进行吗?我找到了几个参考资料,但我不熟悉 bash 脚本。顺便说一句,我正在研究 Ubuntu 16.04.

例如,我有以下文件夹

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

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

Event Hook

aria2 provides options to specify arbitrary command after specific event occurred. Currently following options are available: --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