Removal of wget generated files

Posted by ladless, 09-19-2008, 03:19 PM
Hi there. I have several cronjobs set up like the following example: Obviously a bunch of files are being created in the /root folder. I believe I don't need those files. They all have incremental numbers as extensions. Nothing bad happens if I delete them by hand but after a while they are many and it's annoying. I understand there is a parameter for the wget command: wget --delete-after that deletes those files automatically. My question is if the following cronjobs will work in the new shape: Won't that conflict somehow with the name of the address of the site ? I also thought about using the following form: Which form would do the work ? I basically need to fetch an URL with wget silently. Thanks in advance.

Posted by Panopta, 09-19-2008, 03:31 PM
Wget doesn't write the output of the file to stdout, so redirecting won't work. You need to use the -O option to change the file that is written, which can be set to /dev/null:

Posted by ladless, 09-19-2008, 03:50 PM
Many thanks. I will try that in a minute. Hopefully it will work. Anyway I will get back with an answer, good or bad. Thanks again.

Posted by Harzem, 09-19-2008, 03:52 PM
Won't that conflict somehow with the name of the address of the site ?" No it won't. Wget can understand that --delete-after is an option, because it has dashes before it.

Posted by ladless, 09-20-2008, 02:17 PM
It works. Thanks for your help guys. However yet I have one question: is there a limit for how many cron jobs a server can run ? Would it be ok to have let's say 200 cron jobs like the above ?

Posted by Harzem, 09-20-2008, 02:29 PM
It's best not to have so many. Create single a script that will do all those jobs, and call that script with cron.

Posted by ladless, 09-20-2008, 02:52 PM
Would a script like the following one have the same effect ? I mean would that work ? I basically need to execute those URL's somehow.

Posted by datums, 09-20-2008, 02:54 PM
20 * * * * /usr/bin/wget --delete-after http://sitename.com/file.php

Posted by ladless, 09-20-2008, 03:17 PM
How about the following variant. I will have a cron job to do this: Inside the script.sh I will have this: Would my example work ?

Hasznosnak találta ezt a választ?

 Kinyomtatja ezt a cikket

Olvassa el is

Include and run a script within a program

Posted by Sammyboy99, 02-18-2011, 06:53 PMSo I've made a program that executes a script the only...

Changing File ext. to File

Posted by haleyhosting_com, 03-24-2007, 01:31 PMi have a site upithere.com . its a pretty popular...

aletia reseller

Posted by hostchecker, 09-27-2001, 05:36 PMwhas the URL for aletia reseller plans? Posted by...

upgrade MySql and PHP

Posted by paul-naama, 09-16-2007, 04:55 AMApparently because i wanted LXADMIN HIAB they had to...

Phpmyadmin and Webmail access problem from cpanel

Posted by Doctor_Web, 09-07-2007, 01:02 PMHello, we have a important problem with our cPanel...