The extension for Eric accepted the answer.
Here is my bash script to wait for an external process to download a file. This will block the current execution of the script indefinitely until the file exists.
Key-based access to SSH is required, although this can easily be changed to curl version for HTTP verification.
This is useful for downloading via external systems that use temporary file names:
- rsync
- transmission (torrent)
Script below:
#!/bin/bash set -vx #AUTH=" user@server " AUTH="${1}" #FILE="/tmp/test.txt" FILE="${2}" while (sleep 60); do if ssh ${AUTH} stat "${FILE}" > /dev/null 2>&1; then echo "File found"; exit 0; fi; done;
Drew anderson
source share