Download file to dev/null
Create a free Team What is Teams? Learn more. Asked 7 years, 4 months ago. Active 6 months ago. Viewed k times. I'm quite new to Unix. Using Solaris 10 I faced the below issue.
There is a large log file with size 9. I tried to empty the file using the below command. Is there a way to correct the file size? Is this going to effect my file system?
Improve this question. Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. Do you try to restart the service? I'm sorry people! But anyway, now I can make sense with the below answers what could have gone wrong. Is my syntax incorrect for running the cron job? From a command line it works without a problem but from cron it generates a index. That way redirection is not needed at all.
Do you need to actually download the contents or just receive the OK? If you only have to have the server process the request, why not simply use the --spider argument? The idea is not to discard the output in some way, but not create any output at all. That you only need the response means the data that is downloaded into the local file index. To access a document in a way that does everything except actually downloading the document, there is a special command 'HEAD'.
When using 'GET' for this task, the document is downloaded and discarded locally. Using 'HEAD' does just what you need, it does not transfer the document in the first place. It will allways return the same result code as 'GET' would, by definition. The syntax to use the method HEAD with wget is a little odd: we need to use the option --spider.
We can use the option -q quiet to make wget not output details about what it does. For a command in crontab , the fact that there is no output in both cases means you can use getting no output as an indication of errors again. The additional advantage is that the log output, and the document output, are not generated, instead of generated and discarded locally. Or course the big difference is avoiding to download and then discard the document, index. Sign up to join this community.
The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Learn more. Ask Question. Asked 13 years ago. Active 1 year, 4 months ago.
Viewed k times. Improve this question. Peter Mortensen Ove S Ove S 4, 2 2 gold badges 16 16 silver badges 7 7 bronze badges. Add a comment. Active Oldest Votes. I think you want NUL , at least within a command prompt or batch files. Improve this answer.
Jon Skeet Jon Skeet 1. I just looked at this again, and I retract my original statement. I was doing the write in code, and the error was getting swallowed. I'm deleting it so no one accidentally takes it as the truth.
Viewed times. I googled a bit and it seems it's axel command bug but it's not resolved yet. Improve this question. Saeed Saeed 9 9 bronze badges. What is the purpose of increasing traffic on first server? Because the 1st server is using Mikrotik and will have symmetric traffic and I want it become asymmetric during the month 1 to 4 pattern or even 1 to 6.
The second server has asymmetric and there will be problem for the second server. I will add it to crontab to do it daily. Add a comment. Active Oldest Votes. As Frands Hansen said in comments, I should use wget for this purpose: axel runs multiple threads and thus needs to know about the chunks it is downloading.
0コメント