1
vote
2answers
40 views

Sending most recently created file via Email

I'm trying to send a log file every 24 hours or so via email. Currently I am using mutt for this. You can call mutt like this: mutt -s "Log" -a file_attachment example@example.com I know I can ...
0
votes
1answer
57 views

Writing a Bash script to run and end at specific times

I'd like to create a script that will do the following. Start at a given time during the day and end at another given time. So for example, I have a program I'd like to test, so my script would be ...
0
votes
1answer
46 views

How to measure rlogin time?

I need to monitor the time it takes to rlogin from one HP-UX machine to another. So I wrote this: #!/bin/sh result=`rlogin 10.10.10.1 << EOF exit EOF` result2=`{ time $result >/dev/null; } ...
3
votes
1answer
138 views

CPU is free, yet bash script not utilizing all CPU resources

I ran a simple script to generate a large (10000000 lines) csv file with 6 fields in which some fields changed in each line/row, using a while loop. The machine had all (32) CPUs free, lot of RAM (~31 ...
4
votes
4answers
252 views

Can I write the output the of time difference command to a file?

Can I write the output of the time difference command to a file? For example, I tried: $ time foo.sh > bar.txt But it only gives the output of foo.sh to bar.txt.
6
votes
2answers
5k views

Good method to compare time?

I need to check for the current time and abort the script if it is not proper time of day I am supposed to run it. Also, if anyone else runs it, it should abort. For example: I need my script to only ...
2
votes
5answers
3k views

Get the newest file from directory structure year/month/date/time

I store backups of databases in a directory structure year/month/day/time/backup_name an example would be basics_mini/2012/11/05/012232/RATIONAL.0.db2inst1.NODE0000.20110505004037.001 ...
5
votes
3answers
1k views

How can I profile a shell script?

I have several programs that i'm executing in a shell script: ./myprogram1 ./myprogram2 ... I know that I can profile each individual program by editing the sourcecode, but I wanted to know if ...
8
votes
2answers
686 views

Measuring time within a script

This thread shows how to measure the time it takes to run a script. In my case, I am interested in measuring time between two points within a script. Here is an example of how I would like to use ...
13
votes
3answers
25k views

How to measure time of program execution and store that inside a variable

In order to find out how long certain operations within a Bash (v4+) script take, I would like to parse the output from the time command "separately" and (ultimately) capture it within a Bash variable ...