Skip to content

Instantly share code, notes, and snippets.

@xazax
Created August 1, 2012 11:35
Show Gist options
  • Save xazax/3226050 to your computer and use it in GitHub Desktop.
Save xazax/3226050 to your computer and use it in GitHub Desktop.
Wrapper for loggin timedate from cronscripts.
#!/bin/sh
DATEFORMAT=`date +%F\ %H:%M`
echo "[$DATEFORMAT] Start executing $1"
$@ 2>&1 | sed -e "s/\(.*\)/[$DATEFORMAT] \1/"
echo "[$DATEFORMAT] End executing $1"
@xazax
Copy link
Author

xazax commented Aug 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment