M
M
mr-zherart2017-02-08 00:06:28
linux
mr-zherart, 2017-02-08 00:06:28

Is it possible to run a bash script before downloading and after downloading a file over sftp?

Two developers (or more) are working on one project on a remote server via sftp. One developer can overwrite the results of another. Therefore, I would like to distinguish if you were the last one who edited the file, you can upload a new version, if not, please download it first, and then overwrite it.
The workflow looks like this: programmers develop a project remotely on a server via sftp. Using git flow, final releases are automatically deployed to the production server based on this article ( https://goo.gl/lENlDP).
That's why I'd like to know if it's possible when:
Downloading
The task is to watch for the start of a file download, pause the download, perform a condition check via bash, and abort/continue downloading the file.
Download
Just run the script after downloading the file
. These are my first steps in setting up workflow, while I would like to implement quickly on simple tools, and then add docker, jenkins and more. Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CityCat4, 2017-02-08
@CityCat4

You can't pause a file download via sftp. All conditions must be checked before starting the download by executing commands on a remote host and parsing the result, and only then make a decision about downloading. At least, I don't know the mechanism of how you can pause the download of a file via sftp so that it can be continued later.

D
DuD, 2017-02-08
@DuD

The question is not entirely clear.
You just run the script. Then download something from sftp. Then run the script again. The usual single-threaded scenario. What are your conditions?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question