Guest User

Untitled

a guest
Nov 18th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. date -d '1 hour ago' '+%Y-%m-%d'
  2. `Result` : 2017-11-13
  3. date -d '1 hour ago' '+%Y-%m-%d %H'
  4. Result : 2017-11-13 22
  5.  
  6. date -d '1 hour ago' '+%H'
  7. 22
  8. date '+%H'
  9. 23
  10.  
  11. start=$(date -d '2 hour ago' '+%H')
  12. end=$(date '+%H')
  13. file_name="dns."$start":00:00-"$end":00:00.log"
Add Comment
Please, Sign In to add comment