1

It creates files with 0 Bytes, with the same name as the php being called in the task.

I have a task that runs every minute, my folder /root is crowded.

My task:

* * * * * /usr/bin/wget -q https://domain/script.php

How to stop creating these files?

7
  • What do you want to know? Is it how do I stop these 0 byte files? How does crone Work? How can I stop crone from producing 0byte files? Please expand your question so that it helps others in a similar situation and add the relevant question(s)
    – Simon
    Jul 20, 2013 at 16:12
  • What is the result when you run wget -q https://domain/script.php in terminal? Do you get non 0 bytes file in this case? Jul 20, 2013 at 16:20
  • @SimplySimon I want to know why, and how to disable.
    – Ricardo
    Jul 20, 2013 at 16:21
  • OK, Add this information to your question. You will find that people will ignore your question, or vote it down if it doesn't have enough information in it. :)
    – Simon
    Jul 20, 2013 at 16:24
  • @RaduRădeanu I tested right now, it returns the same file.
    – Ricardo
    Jul 20, 2013 at 16:24

2 Answers 2

1

Why?

Because this is what wget command is doing and because your cron job call wget at every minute. From man wget:

GNU Wget is a free utility for non-interactive download of files from the Web.

It creates files with 0 bytes because probably script.php does not return nothing in non-interactive mode.

How to stop creating these files?

Run in terminal next command to open the crontab file:

crontab -e

and delete or comment the line:

* * * * * /usr/bin/wget -q https://domain/script.php

Save the crontab file and close it.

Or just simple use:

crontab -r

to remove your crontab file.

If you want to make the cron job only to access https://domain/script.php every minute, then use curl, ping or maybe lynx. For example:

* * * * * curl https://domain/script.php

More about: http://v1.corenominal.org/howto-setup-a-crontab-file/

3
  • With this solution I am without a job. I need the job, I just want to prevent the generation of these files.
    – Ricardo
    Jul 20, 2013 at 16:39
  • @Ricardo For what you need the job? This is what your cron job is doing: download a file every minute from https://domain/script.php... Jul 20, 2013 at 16:43
  • I need this page to be accessed by the minute. No need to download. Should I continue using wget?
    – Ricardo
    Jul 20, 2013 at 17:03
1

Code:

wget -a /dev/null https://domain/script.php

This will discard the output altogether. The -q flag just stops wget log messages, not the actual output.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .