Add date and time to filename


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #take backup
  2.  
  3. NOW=$(date +"%b-%d-%y%H:%M")
  4. BKPFILE="hadoop-env-$NOW.sh"
  5. echo $BKPFILE
  6. cp hadoop-env.sh "$BKPFILE"

URL: http://www.cyberciti.biz/tips/shell-scripting-creating-reportlog-file-names-with-date-in-filename.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.