Hilariously rough code to get a backup pushed into S3

This commit is contained in:
Dane Everitt
2020-04-26 17:20:26 -07:00
parent 91d12ab9a7
commit 507d0100cf
4 changed files with 122 additions and 37 deletions

View File

@@ -122,12 +122,11 @@ func (b *LocalBackup) Details() *ArchiveDetails {
go func() {
defer wg.Done()
st, err := os.Stat(b.Path())
if err != nil {
if s, err := b.Size(); err != nil {
return
} else {
sz = s
}
sz = st.Size()
}()
wg.Wait()
@@ -140,19 +139,4 @@ func (b *LocalBackup) Details() *ArchiveDetails {
func (b *LocalBackup) Ignored() []string {
return b.IgnoredFiles
}
// Ensures that the local backup destination for files exists.
func (b *LocalBackup) ensureLocalBackupLocation() error {
d := config.Get().System.BackupDirectory
if _, err := os.Stat(d); err != nil {
if !os.IsNotExist(err) {
return errors.WithStack(err)
}
return os.MkdirAll(d, 0700)
}
return nil
}
}