mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
better dir name
This commit is contained in:
parent
2152447361
commit
181ee445c1
@ -104,8 +104,8 @@ func (a *Agent) dataDir() string {
|
||||
}
|
||||
|
||||
func archiveLogAndDataDir(log string, datadir string) error {
|
||||
dir := fmt.Sprint(time.Now().Format(time.RFC3339))
|
||||
if err := os.Mkdir(dir, 0700); err != nil {
|
||||
dir := path.Join("failure_archive", fmt.Sprint(time.Now().Format(time.RFC3339)))
|
||||
if err := os.MkdirAll(dir, 0700); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.Rename(log, path.Join(dir, log)); err != nil {
|
||||
|
@ -24,7 +24,7 @@ type Agent interface {
|
||||
Stop() error
|
||||
// Restart restarts the existing etcd the agent stopped.
|
||||
Restart() (int, error)
|
||||
// Cleanup stops the exiting etcd the agent started and archived its data dir.
|
||||
// Cleanup stops the exiting etcd the agent started, then archives log and its data dir.
|
||||
Cleanup() error
|
||||
// Terminate stops the exiting etcd the agent started and removes its data dir.
|
||||
Terminate() error
|
||||
|
Loading…
x
Reference in New Issue
Block a user