Skip to content

Instantly share code, notes, and snippets.

@JoeyBurzynski
Created May 1, 2016 19:37
Show Gist options
  • Save JoeyBurzynski/7b7475e4b0dae020be857455855636df to your computer and use it in GitHub Desktop.
Save JoeyBurzynski/7b7475e4b0dae020be857455855636df to your computer and use it in GitHub Desktop.
Bash Scripts: Back Up File With Timestamp
function buf ()
{
local filename=$1
local filetime=$(date +%Y%m%d_%H%M%S)
cp -a "${filename}" "${filename}_${filetime}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment