[ale] line timestamp command

Wolf Halton wolf.halton at gmail.com
Tue Nov 12 23:08:41 EST 2013


I have a piece that adds a formatted date to a file name in this tar command

tar czf "${directory1}""$h"_backups_`date '+%F_%H_%M'`.tar.gz
"${directory2}"*.tar.gz

h=`hostname`


Wolf Halton

--
This Apt Has Super Cow Powers - http://sourcefreedom.com
Security in the Cloud - http://AtlantaCloudTech.com<http://atlantaCloudTech.com>
Apache Developer wolfhalton at apache.org


On Tue, Nov 12, 2013 at 5:53 PM, Derek Carter (aka goozbach) <
goozbach at friocorte.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2013-11-12, 1334, Scott Plante wrote:
> > Does anyone happen to know of a command line tool that will read
> > lines from standard input and write them to std out, pre-pending a
> > timestamp? I have a process that emits messages to std out
> > periodically as it processes and I'd like to write that to a log
> > file, but with a time at the start of the line. I could do it with
> > a script but a nice little command would be better, if it exists.
> >
> > I'm looking for something that would perform the function of this
> > script, maybe with an option for format:
> >
> > while read line; do echo $(date +"%D %T") "$line"; done
> >
> > Scott
>
> I wrote a bash library to do logging in my scripts which might be
> worth a look:
>
> https://github.com/goozbach/log4bats
>
> - --
> Derek
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBAgAGBQJSgrGEAAoJECcWlbcE84qz45oP/09sYJOUhA0KElNZWVFmLmNh
> ovGGINxIIlEiNOnKifpYqpPpZP2pM6Mj43ctaX9ADvB42Jm4eDLdp9pZDPw2VqmS
> +WDBrB9zOuPbCM7A41bvGTP7bMvgLvWt8p0xex9as5QZd7XbAwxYG48qOs6hNHvw
> LhdtOfQeQBEd2/dYxouGQ7+F1Pi5CKSGuNHu6bIuBBwlYjqN+G/qClgt7UiFtR/y
> WnU7rQsGRiZKXWRtAGBkfBl1UdbjfU8yejBaz72uA+rJ1GZ8agG4lpSzd9gzpbE1
> wD6h0NaueAyFHFlwbClfiFZsemkJKCbdvpGmvaE6TjJVAJ8lnw2qpCJ9mEkm3BYi
> mE72dT+okJwdZ7mdE6nnhQn1CR8wyPGpAkA5+eXDSti8YbKrO2RN/RnVAS1bjS6L
> /EcKMGwLzEm2DY1ttWtIZJ5O7daqXwXakyupgmk6XUUpTgidRUD4QrOO2blCaHmv
> s4DfON4QDVZQS8O5cGckNx5pBu5zWOwSHF813BSsxpQEgs0DsMC4QYneiRLy/o7w
> yn4QaRjFj33dQgdaCWHDkLeLADvEuXE2vAY4xVbFoqrSe6DOuCPVpm9SnjVxtTXn
> PWRA03FRJlhyAMZWnXtfnJBsLfdSU3DsWvvjiZ9PbzdGhzhNIL1tsqhIIKNDT+iU
> +X01AgWTQGjBbZkwktgG
> =4Zd+
> -----END PGP SIGNATURE-----
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20131112/9bcb5dc2/attachment.html>


More information about the Ale mailing list