Skip to content

Instantly share code, notes, and snippets.

@kellthenoise
Created December 12, 2018 18:18
Show Gist options
  • Save kellthenoise/27daf8da09eac224801de69b8d25a0e5 to your computer and use it in GitHub Desktop.
Save kellthenoise/27daf8da09eac224801de69b8d25a0e5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# log.sh
# do the following - /usr/bin/script ~/Desktop/Terminal.log
#* Formatted date & time string.
FORMATTED_DATE=`/bin/date "+%Y-%m-%d%H%M%S"`
#* Archive the previous file
/bin/cp -f ~/Desktop/Terminal.log{,.$FORMATTED_DATE.txt}
#* Begin a new one
/usr/bin/script ~/Desktop/Terminal.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment