0
votes
1answer
50 views

Binding timestamp value to a variable in crontab

I'm basically trying to declare a variable with a date() value in crontab as I will constantly be using the same date structure over and over, here is what my crontab looks like so far. php = ...
0
votes
1answer
263 views

Review of a crontab script to add timestamps to minutely runs; any suggestions?

I've got a crontab job set to run minutely as such: * * * * * /home/username/public_html/domain.tld/production/scripts/cron_runner.sh My goal is to add some timestamps to output from cron so I can ...
1
vote
1answer
159 views

Linux date translation to different time zone

The Linux server is hosted in EST timezone. But I want to translate the output of date command to IST(Indian Standard time +5:30 hrs) format and use it in a shell script. Is there any option available ...
1
vote
1answer
218 views

Use shell built-in time while checking exit status of a function and suppressing output

I am attempting to do the following in a bash script and am wondering if it is possible: Time the output of a command (in this case, mysql) using time Suppress the stdout output of the command ...
2
votes
1answer
118 views

Unix Command to timestamp the output of a file, but with the relative-to-when-it-started time?

There are numerous programmes (e.g. ts in moreutils), and various bash one-liners to prepend the output of a command/pipe with the timestamp of when that line was 'printed'. However is there a ...
1
vote
1answer
494 views

Measure query execution time in bash

I need to measure a query total execution time from inside a bash script. Somebody told me to submit something like: mysql --user="someuser" --password="pw" -D "dbname" -e 'your-sql-command;' Is ...
2
votes
1answer
229 views

Why does the time it takes to run this script differ so much between user and system and how I might correct the discrepancy?

My application sits behind a load balancer, and every once in a while I like to do a status check on each machine to get an idea of the time it takes to return an index.html document on each machine. ...
1
vote
2answers
619 views

unix timestamp wrong time with rrdtools

I have problem with unix timestamp ( date +%s ). This command gives me a GMT time, however I am using CET, so the unix timestamp is in 1 hour late (and my rrdtool database too!). How I can change unix ...
66
votes
8answers
87k views

How do I get current Unix time in milliseconds using bash?

How do I get the current Unix time in milliseconds (i.e number of milliseconds since Unix epoch January 1 1970)?
0
votes
4answers
472 views

bash: convert iso dates to d:m:y

I have a program, which produces output like this (iso format dates): 2010-06-04 15:48:17 +0200 2010-06-04 12:34:39 +0200 2010-02-01 14:02:44 +0200 2010-06-04 12:21:19 +0200 2010-06-04 12:21:04 +0200 ...