Answer the question
In order to leave comments, you need to log in
How to run a bash script right after a file is downloaded via wget?
Hello.
Wget downloads the file:
wget -qcO '/var/www/admin/test.yml' http://site.ru/file.yml
wget -qcO '/var/www/admin/test.yml' http://site.ru/file.yml && sh '/var/www/admin/command.sh'
Answer the question
In order to leave comments, you need to log in
wget -qcO '/var/www/admin/test.yml' http://site.ru/file.yml ; sh '/var/www/admin/command.sh'
&&
will only work if the exit code of the previous command is 0. ;
- always wget -qcO '/var/www/admin/test.yml' http://site.ru/file.yml \
sh '/var/www/admin/command.sh'
and so?
Naturally, the script must be with launch rights and a link to the shell in the first line
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question