Sponsored Content
Full Discussion: Gnuplot in bash
Top Forums Shell Programming and Scripting Gnuplot in bash Post 302906815 by Chubler_XL on Monday 23rd of June 2014 06:01:22 PM
Old 06-23-2014
Firstly your going to need to collect hourly usage data into a datafile, cron is probably the best way perhaps something like this:

Code:
for filesystem in var usr tmp
do
   df -Pm /$filesystem | awk -v d=$(date date '+%Y/%m/%d %T') 'NR==2{print d,$3,$4}' OFS="\t" >> /usr/lib/${filesystem}_disk_data
done

Once you have your data you can use gnuplot to produce the grap, below is an example for the var datafile:

Code:
#!/usr/bin/gnuplot

set terminal png font "helvetica"
set output 'var_graph.png'

# For pdf output (requires ps2pdf) replace with below
# set terminal postscript landscape color
# set output '| ps2pdf - var_usage.pdf'

set title "Var filesystem usage over Time"
set timestamp "Last updated: %m/%d/%Y, %H:%M" top

set xlabel "Date (mm/yy)"
set timefmt "%Y/%m/%d %H:%M"
set xdata time
set format x "%m/%Y"

set ylabel "GB"
set yrange [ 0 : ]

set key left
set grid
set datafile separator "\t"

show variables

plot '/usr/lib/var_disk_data'     using 1:2 t 'Used' with lines

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with gnuplot

Hi, I am a beginner using UNIX, and was wondering how to use gnuplot from UNIX on my pc. I am connected remotely to my work's UNIX server using Secure Shell Client, and gnuplot won't open a new window when I use the plot command. How do I do this? Moreover, is it possible to save things from the... (0 Replies)
Discussion started by: KTTFB64
0 Replies

2. UNIX and Linux Applications

GNUplot

Hi, I am trying to make a plot of an ASCII file using GNUplot, but I keep getting error msg: for example plot filename.txt It says that (.txt ) is not identified ... I tried to write it without the .txt part, but I also get the error msg. Any idea why? :confused: (1 Reply)
Discussion started by: cosmologist
1 Replies

3. Shell Programming and Scripting

xargs and gnuplot

Hi All, Seems I have an xargs stdin problem that I don't understand. I have a script (call it myscript.sh) that takes the names of one or more file(s) specified on the command line and creates a single gnuplot command file containing multiple records, one for each specified file. Each of... (9 Replies)
Discussion started by: paulianna2002
9 Replies

4. Shell Programming and Scripting

bash-gnuplot: unexpected end of file

Hi I can't figure out why i get the "unexpected end of file". #! /bin/bash for file1 in /figures/*; do gnuplot << EOF set terminal postscript eps color enhanced set output "$file1.eps" set bar 1.000000 ... (2 Replies)
Discussion started by: Dedalus
2 Replies

5. Emergency UNIX and Linux Support

GNUPLOT help needed

Dear All, I am new to GNUPLOT :D and dont know how it works, but actually there is a LINUX script generated by me which is running & capturing data in real time, the problem is that i want to plot that data in real time using GNUPLOT.:confused: please help.:wall: (5 Replies)
Discussion started by: jojo123
5 Replies

6. UNIX for Dummies Questions & Answers

Need help! How to gnuplot a picture??

I would like to ask if I have already plot a graph using gnuplot, the setting(made by others) is in "gnuplot.defaults": gnuplot> load '<ParadisDir>/inputs/gnuplot.defaults' gnuplot> splot 'box.in' with lines, '0t0001' w lines How to transform it to bmp file? (or other types of pictures?) ... (2 Replies)
Discussion started by: kelvin490
2 Replies

7. Shell Programming and Scripting

gnuplot do not take my variable

Hi! i want to print ot my data of the last seven days with gnuplot. in a script i put my gnuplot-script and at the top i generate my date-variable. #/bin/bash -e # Gnuplot script "API_Status.txt" # set terminal postscript color landscape dl 2 lw 2 'Helvetica' 15 ; # set output... (2 Replies)
Discussion started by: IMPe
2 Replies

8. Shell Programming and Scripting

Gnuplot 3d binning

Hello I have a text file with tens of thousands of rows The format is x y where both x and y can be anything between -100 and +100. What I would like to do is have a 3d gnuplot where there are 10,000 squared or bins and each bin will count how many rows have a value that would be... (1 Reply)
Discussion started by: garethsays
1 Replies

9. Shell Programming and Scripting

Gnuplot script

Need assistance in getting a script right. It requires little tweaking and I am not getting it right . Using below data and the below script it creates a table with png file but regarding the time it create 6,7,8 and i want each time 6:15 ,6:30 and so on So that i can view the exact graph... (3 Replies)
Discussion started by: ajayram_arya
3 Replies
PS2PDF(1)							    Ghostscript 							 PS2PDF(1)

NAME
ps2pdf - Convert PostScript to PDF using ghostscript ps2pdf12 - Convert PostScript to PDF 1.2 (Acrobat 3-and-later compatible) using ghostscript ps2pdf13 - Convert PostScript to PDF 1.3 (Acrobat 4-and-later compatible) using ghostscript SYNOPSIS
ps2pdf [options...] {input.[e]ps|-} [output.pdf|-] ps2pdf12 [options...] {input.[e]ps|-} [output.pdf|-] ps2pdf13 [options...] {input.[e]ps|-} [output.pdf|-] DESCRIPTION
The ps2pdf scripts are work-alikes for nearly all the functionality (but not the user interface) of Adobe's Acrobat(TM) Distiller(TM) prod- uct: they convert PostScript files to Portable Document Format (PDF) files. If the output filename is not specified, the output is placed is a file of the same name with a '.pdf' extension. Either the input filename or the output filename can be '-' to request reading from stdin or writing to stdout, respectively, when used as a filter. The three scripts differ as follows: - ps2pdf12 will always produce PDF 1.2 output (Acrobat 3-and-later compatible). - ps2pdf13 will always produce PDF 1.3 output (Acrobat 4-and-later compatible). - ps2pdf per se currently produces PDF 1.4 output. However, this may change in the future. If you care about the compatibility level of the output, use ps2pdf12 or ps2pdf13, or use the -dCompatibility=1.x switch in the command line. There are some limitations in ps2pdf's conversion. See the HTML documentation for more information. A large number of Adobe Distiller(TM) parameters which can be used to control the conversion are also documented there, including instructions for generating PDF/X and PDF/A documents. OPTIONS
The ps2pdf scripts use the same options as gs(1). EXAMPLES
Converting a figure.ps to figure.pdf: ps2pdf figure.ps A conversion with more specifics: ps2pdf -dPDFSETTINGS=/prepress figure.ps proof.pdf Converting as part of a pipe: make_report.pl -t ps | ps2pdf -dCompatibility=1.3 - - | lpr SEE ALSO
gs(1), ps2pdfwr(1), Ps2pdf.htm in the Ghostscript documentation BUGS
See http://bugs.ghostscript.com/ and the Usenet news group comp.lang.postscript. VERSION
This document was last revised for Ghostscript version 8.70. AUTHOR
Artifex Software, Inc. are the primary maintainers of Ghostscript. This manpage by George Ferguson. 8.70 31 July 2009 PS2PDF(1)
All times are GMT -4. The time now is 02:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy