Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Stats

Status
Not open for further replies.

dcomit

Technical User
Jun 20, 2001
115
GB
We want to graph the number of users on our aix system. We are currently doing this by running a cron job to do the uptime command every 10 minutes and append the results to a file. Problem is that it doesn’t output the date. Can anyone suggest a command or a simple script to enable us to achieve this by producing a file that could be directly imported into a spreadsheet?
 
I don't know anything about spreadsheets, really, but I think they can import comma-delimited text files. So separate your fields with commas.

If you want AIX to tell you the date, you use the `date` command.

If you want both uptime and date on one line, try this:
print `uptime;date` >> log.file

Have fun. IBM Certified -- AIX 4.3 Obfuscation
 
Yegolev,

print 'uptime;date' >> log.file
This puts uptime;date into the file.

uptime;date>>log.file
This outputs the results of the uptime command to stdout and puts the current date and time into the logfile.

Am I missing something?
 
It works now that I'm using the ` instead of '.
Thanks very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top