diff options
-rw-r--r-- | cmd/crawl/crawl.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/crawl/crawl.go b/cmd/crawl/crawl.go index b3ab049..f2c4394 100644 --- a/cmd/crawl/crawl.go +++ b/cmd/crawl/crawl.go @@ -309,13 +309,15 @@ func main() { log.Fatal(err) } } else { - if _, err := os.Stat(host); os.IsNotExist(err) { - err := os.Mkdir(host, 0700) + shortForm := "2006-01-02" + d := host+"-"+time.Now().Format(shortForm) + if _, err := os.Stat(d); os.IsNotExist(err) { + err := os.Mkdir(d, 0700) if err != nil { log.Fatal(err) } } - err := os.Chdir(host) + err := os.Chdir(d) if err != nil { log.Fatal(err) } |