Sponsored Content
Operating Systems Linux Gentoo top in batch mode, cpu info is wrong Post 302225910 by broli on Sunday 17th of August 2008 05:53:46 PM
Old 08-17-2008
Quote:
Originally Posted by Franklin52
If the second iteration is correct you can shorten the delay with the -d option and print the result of the second iteration with awk, this works on a Debian Linux system:

Code:
top -b -n2 -d0.01 | awk '/^top/{i++}i==2' > somefile

Regards
thanks, but it didnt worked :/

this is a screenshot of my script (below) and top at the same time.
screenshot on Flickr - Photo Sharing!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help ! How to get elm to send multiple attachments - in batch mode

From a program, I want to execute a UNIX elm command that will send multiple txt attachment files to an email address. I can do it for one attachment only ie. "elm -s"subject" emailaddress < attachment.txt" 1. The attachment is received in the body of the email and not as an attachment. 2. The... (1 Reply)
Discussion started by: anarvan
1 Replies

2. Shell Programming and Scripting

su command in batch mode

Hi, how do we change user in a shell script- batch mode. Thanks, Rajesh (3 Replies)
Discussion started by: Rajesh Gohad
3 Replies

3. Shell Programming and Scripting

SSH in batch mode and File-Handles in a loop

Hi all I try to execute SSH commands on several hosts in a while-loop. There seems to be a problem with file-handle, first cycle works correct but no other one will follow due to the while condition is false even that there are many more host entries (lines) in all_hosts.dat. ... (3 Replies)
Discussion started by: DaveCutler
3 Replies

4. UNIX for Advanced & Expert Users

Sftp in Batch Mode

Hi, I am trying to do sftp a file from one server to another solaris server. Both are sftp enabled. I have generated the rsa key in local server and did a ftped the public key to the remote server and added that in the authorization keys file. Then i try to run the below command using a... (2 Replies)
Discussion started by: sivaemn
2 Replies

5. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

6. AIX

Need a list of top 10 CPU using processes (also top 10 memory hogs, separately)

Okay, I am trying to come up with a multi-platform script to report top ten CPU and memory hog processes, which will be run by our enterprise monitoring application as an auto-action item when the CPU and Memory utilization gets reported as higher than a certain threshold I use top on other... (5 Replies)
Discussion started by: thenomad
5 Replies

7. Shell Programming and Scripting

How to run VI in batch mode

Hi how do I use vi to do change some strings in a shell script loop 1. Run ls first, for each file that contains the word salesreport*.txt, do the following 2. use vi to run the following ex command : "1,$s/1975/1945/ig, wq" Please tell me how to do this in vi, not sed. Thank you. (5 Replies)
Discussion started by: grossgermany
5 Replies

8. HP-UX

how to run glance over ssh in batch mode

Hello; Is it possible to run glance over ssh in batch mode ?? Similar to running " top -f " command over ssh.. Need to get glance output for specific pids Thnx very much (5 Replies)
Discussion started by: delphys
5 Replies

9. Shell Programming and Scripting

FTP in batch mode

HI, Need to ftp a bunch of files in a directory in batch mode. TRying to ftp a single file first with below code. #!/bin/ksh function ftp_files { ftp -n ${D2_SRVR} <<-EOF quote user ${D2_UID} quote pass ${D2_PWD} cd ${D2_DIR}/${D2_NAME} lcd ${D1_DIR}/${D1_NAME}/dml/ put file1 ... (6 Replies)
Discussion started by: cvsanthosh
6 Replies

10. Shell Programming and Scripting

tftp batch mode within bash script

Hi, I put the necessary tftp commands into a batch file and I can run tftp by $ tftp < tftpbatchscript in bash command line and then successfully exit. Now, I want to put a line which does the same thing above. However, when I put this line into a bash script, the lines below this line... (1 Reply)
Discussion started by: yildiz.a
1 Replies
FLICKR_UPLOAD(1p)					User Contributed Perl Documentation					 FLICKR_UPLOAD(1p)

NAME
flickr_upload - Upload photos to "flickr.com" SYNOPSIS
flickr_upload [--auth] --auth_token <auth_token> [--title <title>] [--description description] [--public <0|1>] [--friend <0|1>] [--family <0|1>] [--tag <tag>] [--option key=value] [--progress] <photos...> DESCRIPTION
Batch image uploader for the Flickr.com service. flickr_upload may also be useful for generating authentication tokens against other API keys/secrets (i.e. for embedding in scripts). OPTIONS
--auth The "--auth" flag will cause flickr_upload to generate an authentication token against it's API key and secret (or, if you want, your own specific key and secret). This process requires the caller to have a browser handy so they can cut and paste a url. The resulting token should be kept somewhere like "~/.flickrrc" since it's necessary for actually uploading images. --auth_token <auth_token> Authentication token. You must get an authentication token using "--auth" before you can upload images. See the EXAMPLES section. --title <title> Title to use on all the images. Optional. --description <description> Description to use on all the images. Optional. --public <0|1> Override the default "is_public" access control. Optional. --friend <0|1> Override the default "is_friend" access control. Optional. --family <0|1> Override the default "is_family" access control. Optional. --tag <tag> Images are tagged with "tag". Multiple "--tag" options can be given, or you can just put them all into a single space-separated list. If you want to define a tag with spaces, the quotes have to be part of the tag itself. The following works in bash: flickr_upload --tag='"tag one"' --tag='"tag two"' image.jpg --option key=value Flickr periodically adds new features to the uploading API, and these are almost always implemented as new key/value pairs. Rather than waiting for a new Flickr::Upload release, you can specify any of the upload API's optional arguments using "--option". flick_upload --option content_type=1 --tag='cats' two_cats.jpg You may also use "--option" rather than flickr_upload's command-line options: flickr_upload --option is_public=1 --option title='cats' two_cats.jpg While Flickr may add new options at any time (see <http://flickr.com/services/api/upload.api.html> for the most up-to-date list), currently known options include: --option safety_level=<1|2|3> Override the default "safety_level" notation. Set to 1 for Safe, 2 for Moderate, or 3 for Restricted. Refer to <http://www.flickr.com/help/filters/>. --option content_type=<1|2|3> Override the default "content_type" notation. Set to 1 for Photo, 2 for Screenshot, or 3 for Art/Illustration. Refer to <http://www.flickr.com/help/filters/>. --option hidden=<1|2> Override the default "hidden" notation. Set to 1 to keep the photo in global search results, 2 to hide from public earches. Note that options unknown to Flickr will result in undefined behaviour. --check Checks the authentication token via the flickr.auth.checkToken API call. This can be used to verify API keys and credentials without trying to upload an image. The output is the raw results of the API call. --progress Display a progress bar for each upload with Term::ProgressBar. That optional module will have to be installed on the system. --key <api_key> --secret <secret> Your own API key and secret. This is useful if you want to use flickr_upload in auth mode as a token generator. You need both "key" and "secret". Both "key" and "secret" can be placed in "~/.flickrrc", allowing to mix flickr_upload with your own scripts using the same API key and authentication token. Getting your own API key and secret is encouraged if you're tying flickr_upload to some automated process. Note that if you do get an authentication token against your own API key and secret, you'll need to specify the key and secret along with the token when uploading images. The default flickr_upload API key and token won't work in that case. <photos...> List of photos to upload. Uploading stops as soon as a failure is detected during the upload. The script exit code will indicate the number of images on the command line that were not uploaded. For each uploaded image, a Flickr URL will be generated. flickr_upload uses asynchronous uploading so while the image is usually transferred fairly quickly, it might take a while before it's actually available to users. flickr_upload will wait around for that to complete, but be aware that delays of upwards of thirty minutes have (rarely) been know to occur. EXAMPLES
First, you need to get an authentication token. This is a requirement driven by how Flickr manages third-party applications: cpb@earth:~$ flickr_upload --auth 1. Enter the following URL into your browser http://flickr.com/services/auth?api_sig=<...>&frob=<...>&perms=write&api_key=<...> 2. Follow the instructions on the web page 3. Hit <Enter> when finished. Your authentication token for this application is <token> Unless you like typing long numbers on the command-line, you should keep the "<token"> somewhere handy, like a configuration file: echo auth_token=<token> >~/.flickrrc Uploading a bunch of images is then as easy as: flickr_upload --tag 'dog' 'kernel in a window.jpg' 'sad in sunbeam.jpg' CONFIGURATION
To avoid having to remember authentication tokens and such (or have them show up in the process table listings), default values will be read from "$HOME/.flickrrc" if it exists. Any field defined there can, of course, be overridden on the command line. For example: # my config at $HOME/.flickrrc auth_token=334455 is_public=0 is_friend=1 is_family=1 Note, however, that these defaults override the defaults you've assigned in your Flickr profile. You may want to do all that stuff in one place. BUGS
Error handling could be better. AUTHOR
Christophe Beauregard, cpb@cpan.org. SEE ALSO
flickr.com Flickr::Upload <http://flickr.com/services/api/> <http://www.flickr.com/help/filters/> perl v5.10.0 2008-10-27 FLICKR_UPLOAD(1p)
All times are GMT -4. The time now is 07:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy