Search Results

Search: Posts Made By: Sepia
3,642
Posted By Sepia
Cron job to run a command from another dir?
I would like to setup a cron job to run a command from another directory.

What is the best way to do this?

The cron file is in a directory and the script I want it to run is in another...
48,865
Posted By Sepia
Thats a shame. Thanks for your help.
Thats a shame.

Thanks for your help.
48,865
Posted By Sepia
It works fine for me on an echo but not with the...
It works fine for me on an echo but not with the grep.



That works fine with echo and grep! Thank you.

Any ideas how I can >> the output to a file on another server?

Have tried >>...
48,865
Posted By Sepia
Yes, it is 'User Session: Current user count:...
Yes, it is 'User Session: Current user count: 300' and is coming out as ',Thu Jun 25 12:56:00 BST 2009count: 300'

Also, how can I add another input like date.

I've tried doing sed...
48,865
Posted By Sepia
No joy, still missing text. Thanks. ...
No joy, still missing text.



Thanks. Changed it to `date` and it is now displayed properly.

Thanks.
48,865
Posted By Sepia
Thanks but that is now doing: ,Thu Jun 25...
Thanks but that is now doing:

,Thu Jun 25 13:04:59 BST 2009count: 3

Where 'count 3' should have four words infront of it!

I've tried changing the order of sed "s/$/,$(date)/" around but that...
48,865
Posted By Sepia
Excellent. That is putting the date before...
Excellent.

That is putting the date before the grep result - is there a way to switch it around and maybe separate them by a comma?
48,865
Posted By Sepia
Append file with grep output but add timestamp?
I've setup a cron job that greps a file every five minutes and then writes (appends) the grep output/result to another file:

grep "monkey" zoo.log | tail -1 >> cron-zoo-log

Is there any way I...
15,944
Posted By Sepia
Are you sure that is not or rather than and? It...
Are you sure that is not or rather than and? It is showing lines with just one string in.
15,944
Posted By Sepia
Grep for lines with X and Y
Is it possible to grep for lines in a file that have two strings?

I am grepping a tail -f of a file.

I want to display the full line or all lines with cat and dog in them

#tail -f log.log |...
63,230
Posted By Sepia
That's great. Thanks.
That's great. Thanks.
63,230
Posted By Sepia
Output to file but append rather than overwrite?
I am running a command which has a parameter that outputs the results to a file each time it is run.

Here is the command:

--fullresult=true > importlog.xml

Can I add the output to the file...
2,087
Posted By Sepia
Thanks. That did the trick.
Thanks. That did the trick.
2,087
Posted By Sepia
Command that creates file and also greps that file?
I have a command that does something and then creates a log file (importlog.xml).

I then want to grep that newly created log (importlog.xml) file for a certain word (success).

I then want to...
2,238
Posted By Sepia
Sorry, do I enter all three lines to uncompress?
Sorry, do I enter all three lines to uncompress?
2,238
Posted By Sepia
See the date of file after its been zipped and unzipped?
I have some log files that have been gzipped and then compressed using cpio.

There are a number of log files that have been compressed to the one file.

When I extract them the date of the file...
103,037
Posted By Sepia
Copy file from local machine to server?
I am logged into a server via SSH.

There is a file on my desktop of my Windows PC I would like to put on that server.

How do I do it?

SCP looks the likely method but how does the server know...
44,416
Posted By Sepia
Installing Webalizer and GD Library
I tried to install webalizer on my Solaris Unix server so I can look at some webserver logs. I did not have libgd installed so I installed it and I think it went ok (not sure how to tell).

But...
5,951
Posted By Sepia
Thanks.
Thanks.
3,090
Posted By Sepia
No sorry, been busy with my day job, only had a...
No sorry, been busy with my day job, only had a few minutes now to come back to it.
3,090
Posted By Sepia
Yes the file is rather large so I will use awk. ...
Yes the file is rather large so I will use awk.

Do you know how I could go about doing a find and replace on one of the strings?

For example on string2 of this grep "^string1" "^string2" file >...
5,951
Posted By Sepia
Thanks for that! Not sure how I can go about...
Thanks for that!

Not sure how I can go about changing the Apr into a 4 and Jan into a 1 and so on...

Any ideas?
5,951
Posted By Sepia
Find, Replace & Edit a string?
Is this something SED would be used for or can AWK do it?

I have a string that I would like to chop bits out of and re-arrange some of the rest.

Basically I want to change this:
<log4j:event...
3,090
Posted By Sepia
Thank you very much.
Thank you very much.
3,090
Posted By Sepia
Excellent, thanks! What if I wanted to do...
Excellent, thanks!

What if I wanted to do two in one:

grep "^string1" "^string2" file > newfile

With either grep or awk?
Showing results 1 to 25 of 49

 
All times are GMT -4. The time now is 06:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy