Skip to content

Instantly share code, notes, and snippets.

@pacojp
Created July 18, 2013 05:38
Show Gist options
  • Save pacojp/6026927 to your computer and use it in GitHub Desktop.
Save pacojp/6026927 to your computer and use it in GitHub Desktop.
easy backup maker :)
#!/bin/sh
usage(){
echo "Usage: bckconf filename"
exit 1
}
# args error
[[ $# -eq 0 ]] && usage
if [ -f $1 ]
then
cp -f $1 $1.`date '+%Y%m%d_%H'`
else
echo "file $1 not found"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment