wget, logging the output and the response
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I calling an url using wget. This url gives me a response, its a Message id. I want to write the logs to a log file, with the message id as well. Also the log should be appended each time. I trying to do it in my shell script.
Is it possible to do this? If so how can i do it.
bash shell-script logs wget output
add a comment |Â
up vote
0
down vote
favorite
I calling an url using wget. This url gives me a response, its a Message id. I want to write the logs to a log file, with the message id as well. Also the log should be appended each time. I trying to do it in my shell script.
Is it possible to do this? If so how can i do it.
bash shell-script logs wget output
Did you already try usingwget
's--append-output=logfile
(-a logfile
) option? It looks like it is precisely what you would need.
â Emeric
Aug 4 '15 at 6:58
@Emeric I have tried that it works fine for writing the output to the file. I also want the response to be written to the same file after the output. I need help with this.
â Ace
Aug 4 '15 at 7:04
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I calling an url using wget. This url gives me a response, its a Message id. I want to write the logs to a log file, with the message id as well. Also the log should be appended each time. I trying to do it in my shell script.
Is it possible to do this? If so how can i do it.
bash shell-script logs wget output
I calling an url using wget. This url gives me a response, its a Message id. I want to write the logs to a log file, with the message id as well. Also the log should be appended each time. I trying to do it in my shell script.
Is it possible to do this? If so how can i do it.
bash shell-script logs wget output
bash shell-script logs wget output
asked Aug 4 '15 at 6:52
Ace
10315
10315
Did you already try usingwget
's--append-output=logfile
(-a logfile
) option? It looks like it is precisely what you would need.
â Emeric
Aug 4 '15 at 6:58
@Emeric I have tried that it works fine for writing the output to the file. I also want the response to be written to the same file after the output. I need help with this.
â Ace
Aug 4 '15 at 7:04
add a comment |Â
Did you already try usingwget
's--append-output=logfile
(-a logfile
) option? It looks like it is precisely what you would need.
â Emeric
Aug 4 '15 at 6:58
@Emeric I have tried that it works fine for writing the output to the file. I also want the response to be written to the same file after the output. I need help with this.
â Ace
Aug 4 '15 at 7:04
Did you already try using
wget
's --append-output=logfile
(-a logfile
) option? It looks like it is precisely what you would need.â Emeric
Aug 4 '15 at 6:58
Did you already try using
wget
's --append-output=logfile
(-a logfile
) option? It looks like it is precisely what you would need.â Emeric
Aug 4 '15 at 6:58
@Emeric I have tried that it works fine for writing the output to the file. I also want the response to be written to the same file after the output. I need help with this.
â Ace
Aug 4 '15 at 7:04
@Emeric I have tried that it works fine for writing the output to the file. I also want the response to be written to the same file after the output. I need help with this.
â Ace
Aug 4 '15 at 7:04
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
0
down vote
accepted
wget -O - $url --append-output=logfile >> logfile
Specifying -
as filename for -O
writes the output to stdout.
My shell does not hate using logfile
for both append operations. It might work for you as well.
It works like a charm, Thanks, but is there a way to have the response after the output instead of the with the output.
â Ace
Aug 4 '15 at 7:21
You can try using-nv, --no-verbose
option. It reduces the-a
part to a single line, but that single line can only be displayed after the requested contents have been retrieved (and therefore written to the logfile) since it also records whether the retrieval was successful.
â Emeric
Aug 4 '15 at 14:49
add a comment |Â
up vote
0
down vote
I found a work around
wget --no-check-certificate -O contnt -a logfile $url
cat contnt >> logfile
rm contnt
is there any other better way of doing this which doesnt include reading from the file and deleting the file?
add a comment |Â
up vote
0
down vote
You can do it like this:
wget - $url --server-response --append-output=logfile
New contributor
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
wget -O - $url --append-output=logfile >> logfile
Specifying -
as filename for -O
writes the output to stdout.
My shell does not hate using logfile
for both append operations. It might work for you as well.
It works like a charm, Thanks, but is there a way to have the response after the output instead of the with the output.
â Ace
Aug 4 '15 at 7:21
You can try using-nv, --no-verbose
option. It reduces the-a
part to a single line, but that single line can only be displayed after the requested contents have been retrieved (and therefore written to the logfile) since it also records whether the retrieval was successful.
â Emeric
Aug 4 '15 at 14:49
add a comment |Â
up vote
0
down vote
accepted
wget -O - $url --append-output=logfile >> logfile
Specifying -
as filename for -O
writes the output to stdout.
My shell does not hate using logfile
for both append operations. It might work for you as well.
It works like a charm, Thanks, but is there a way to have the response after the output instead of the with the output.
â Ace
Aug 4 '15 at 7:21
You can try using-nv, --no-verbose
option. It reduces the-a
part to a single line, but that single line can only be displayed after the requested contents have been retrieved (and therefore written to the logfile) since it also records whether the retrieval was successful.
â Emeric
Aug 4 '15 at 14:49
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
wget -O - $url --append-output=logfile >> logfile
Specifying -
as filename for -O
writes the output to stdout.
My shell does not hate using logfile
for both append operations. It might work for you as well.
wget -O - $url --append-output=logfile >> logfile
Specifying -
as filename for -O
writes the output to stdout.
My shell does not hate using logfile
for both append operations. It might work for you as well.
answered Aug 4 '15 at 7:14
Emeric
793310
793310
It works like a charm, Thanks, but is there a way to have the response after the output instead of the with the output.
â Ace
Aug 4 '15 at 7:21
You can try using-nv, --no-verbose
option. It reduces the-a
part to a single line, but that single line can only be displayed after the requested contents have been retrieved (and therefore written to the logfile) since it also records whether the retrieval was successful.
â Emeric
Aug 4 '15 at 14:49
add a comment |Â
It works like a charm, Thanks, but is there a way to have the response after the output instead of the with the output.
â Ace
Aug 4 '15 at 7:21
You can try using-nv, --no-verbose
option. It reduces the-a
part to a single line, but that single line can only be displayed after the requested contents have been retrieved (and therefore written to the logfile) since it also records whether the retrieval was successful.
â Emeric
Aug 4 '15 at 14:49
It works like a charm, Thanks, but is there a way to have the response after the output instead of the with the output.
â Ace
Aug 4 '15 at 7:21
It works like a charm, Thanks, but is there a way to have the response after the output instead of the with the output.
â Ace
Aug 4 '15 at 7:21
You can try using
-nv, --no-verbose
option. It reduces the -a
part to a single line, but that single line can only be displayed after the requested contents have been retrieved (and therefore written to the logfile) since it also records whether the retrieval was successful.â Emeric
Aug 4 '15 at 14:49
You can try using
-nv, --no-verbose
option. It reduces the -a
part to a single line, but that single line can only be displayed after the requested contents have been retrieved (and therefore written to the logfile) since it also records whether the retrieval was successful.â Emeric
Aug 4 '15 at 14:49
add a comment |Â
up vote
0
down vote
I found a work around
wget --no-check-certificate -O contnt -a logfile $url
cat contnt >> logfile
rm contnt
is there any other better way of doing this which doesnt include reading from the file and deleting the file?
add a comment |Â
up vote
0
down vote
I found a work around
wget --no-check-certificate -O contnt -a logfile $url
cat contnt >> logfile
rm contnt
is there any other better way of doing this which doesnt include reading from the file and deleting the file?
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I found a work around
wget --no-check-certificate -O contnt -a logfile $url
cat contnt >> logfile
rm contnt
is there any other better way of doing this which doesnt include reading from the file and deleting the file?
I found a work around
wget --no-check-certificate -O contnt -a logfile $url
cat contnt >> logfile
rm contnt
is there any other better way of doing this which doesnt include reading from the file and deleting the file?
answered Aug 4 '15 at 7:12
Ace
10315
10315
add a comment |Â
add a comment |Â
up vote
0
down vote
You can do it like this:
wget - $url --server-response --append-output=logfile
New contributor
add a comment |Â
up vote
0
down vote
You can do it like this:
wget - $url --server-response --append-output=logfile
New contributor
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You can do it like this:
wget - $url --server-response --append-output=logfile
New contributor
You can do it like this:
wget - $url --server-response --append-output=logfile
New contributor
New contributor
answered 9 mins ago
Hiccup
101
101
New contributor
New contributor
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f220070%2fwget-logging-the-output-and-the-response%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Did you already try using
wget
's--append-output=logfile
(-a logfile
) option? It looks like it is precisely what you would need.â Emeric
Aug 4 '15 at 6:58
@Emeric I have tried that it works fine for writing the output to the file. I also want the response to be written to the same file after the output. I need help with this.
â Ace
Aug 4 '15 at 7:04