Cron creating files on the server

Asked

Viewed 46 times

0

I have the controls:

curl https://meusite.com/acesso/cron/cotacoes
wget https://meusite.com/acesso/cron/CPTEC

It performs these two commands which are responsible for saving some photos on the server, the problem is that apart from it saving the photos (they save the photos in the correct folder) they are creating files in the folder '/' with the end of URL.NUMBER, as an example:

cotacoes.01
CPTEC.01

The problem is I don’t know why they’re creating it, because I didn’t put out any commands to create it. If it’s the case and easier I could even save, but in the folder /stations/

How can I fix it? I needed it to stop generating these files or by the smallest indicate a folder for it to save to get organized.

1 answer

1

To determine a directory where files will be saved, with wget simply enter the parameter -O, ex:

# Salva na raiz
wget https://meusite.com/acesso/cron/CPTEC -O /
# Salva em um subdiretório
wget https://meusite.com/acesso/cron/CPTEC -O /estacoes/

curl simply enter the parameter -o, note that the parameter here is minuscule, eg:

# Salva na raiz
curl -o / https://meusite.com/acesso/cron/cotacoes
# Salva em um subdiretório
curl -o /cotacoes/ https://meusite.com/acesso/cron/cotacoes

Note that in CURL first you inform the location where you will be saved and then the URL, already in the Wget comes to URL then the place where you will be saved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.