Browse Source

local file sink: create backup files with permission 0755

pull/1862/head
Chris Lu 4 years ago
parent
commit
f2fcb77808
  1. 4
      weed/replication/sink/localsink/local_sink.go

4
weed/replication/sink/localsink/local_sink.go

@ -78,13 +78,13 @@ func (localsink *LocalSink) CreateEntry(key string, entry *filer_pb.Entry, signa
if _, err := os.Stat(dir); os.IsNotExist(err) { if _, err := os.Stat(dir); os.IsNotExist(err) {
glog.V(4).Infof("Create Direcotry key: %s", dir) glog.V(4).Infof("Create Direcotry key: %s", dir)
if err = os.MkdirAll(dir, 0); err != nil {
if err = os.MkdirAll(dir, 0755); err != nil {
return err return err
} }
} }
writeFunc := func(data []byte) error { writeFunc := func(data []byte) error {
writeErr := ioutil.WriteFile(key, data, 0)
writeErr := ioutil.WriteFile(key, data, 0755)
return writeErr return writeErr
} }

Loading…
Cancel
Save