Getting No Such File in Directory running wget script
Matthew Barrera
I'm very new to Ubuntu and scripting. I am a Windows sysadmin. I need to schedule a .csv download once a day for my job.
First I tried to use the windows version of WGET and had was able to create this script but when using windows Task Scheduler it wouldn't work. I think maybe it had a problem with the script trying to run too fast and not allowing it to authenticate (just a guess).
F:\Exports\WGET\wget.exe -O F:\Exports\WGET\TEST\TEST_Export.csv "" --no-check-certificate -r -P TESTI couldn't figure it out so then I thought maybe I can install Ubuntu on a VM and give Ubuntu a shot since I know WGET is a linux command and have always wanted to use Ubuntu.
I opened gpedit and created this version of the script tested it on the Terminal by copy and paste and it works.
wget -O /home/gdadmin/Desktop/Exports/TEST.csv "" --no-check-certificateI saved it as test.sh on the Desktop and made it executable using:
chmod +x /home/gdadmin/Desktop/test.sh. Then I tried opening the terminal to run the script:
./home/gdadmin/Desktop/test.shI get:
bash: ./home/gdadmin/Desktop/qual.sh: No such file or directoryI'm reading that I may be missing dependencies but I'm not sure what to do. I am just trying turn it into a executable file so that I can then figure out how to schedule it. I am planning on reading about using Crontab but first I want to test it as a file so I can start trying to run it on Crontab.
Any guidance would be greatly appreciated!
31 Answer
Stop! Hold your horses!
You've installed a VM tu run one single command? Windows is a fully compliant POSIX OS (meaning: it's "kind of compatible" with Unix) and you don't need a VM for that!
Your problem is the https:// and using --no-certificate is not going to cut it if that server needs log-in information! So the URL OMITTED is actually needed to help you find a satisfying solution, as the wget manual clearly states.
So you need to give more information or figure out yourself if the server needs certificates / keys / login information, ... to define the additional wget parameters you need to get the ssl/tls/... up and running so that wget can do its job...
(And you can make it fully work under Windows too, no Unix VM needed)
1