Skip to content

Instantly share code, notes, and snippets.

@jamiesun
Created September 21, 2012 10:49
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 jamiesun/3760871 to your computer and use it in GitHub Desktop.
Save jamiesun/3760871 to your computer and use it in GitHub Desktop.
#!/bin/bash
logs_path="/var/log/named/"
oldlogs=${logs_path}dns_logs
newlogs=${logs_path}dns_logs_$(date -d "yesterday" +"%Y%m%d")
rm -fr ${newlogs}
cp ${oldlogs} ${newlogs}
echo "" > ${oldlogs}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment