Skip to content

Instantly share code, notes, and snippets.

@olih
Created May 23, 2013 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olih/5635430 to your computer and use it in GitHub Desktop.
Save olih/5635430 to your computer and use it in GitHub Desktop.
Create a tar or tar.gz archive with a date using the ISO 8601 format. 1. Install the functions with your aliases (ex: .bash_profile MacOS) 2. Usage: tard folder tarzd folder
function tard { tar cvf $1-$(date +%Y-%m-%dT%H:%MZ).tar $1;}
export tard
function tarzd { tar cvfz $1-$(date +%Y-%m-%dT%H:%MZ).tar.gz $1;}
export tarzd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment