| 593 | } |
| 594 | |
| 595 | func changeLocalBackup(oldPath, newPath string) error { |
| 596 | fileOp := files.NewFileOp() |
| 597 | if fileOp.Stat(path.Join(oldPath, "app")) { |
| 598 | if err := fileOp.CopyDir(path.Join(oldPath, "app"), newPath); err != nil { |
| 599 | return err |
| 600 | } |
| 601 | } |
| 602 | if fileOp.Stat(path.Join(oldPath, "database")) { |
| 603 | if err := fileOp.CopyDir(path.Join(oldPath, "database"), newPath); err != nil { |
| 604 | return err |
| 605 | } |
| 606 | } |
| 607 | if fileOp.Stat(path.Join(oldPath, "directory")) { |
| 608 | if err := fileOp.CopyDir(path.Join(oldPath, "directory"), newPath); err != nil { |
| 609 | return err |
| 610 | } |
| 611 | } |
| 612 | if fileOp.Stat(path.Join(oldPath, "system_snapshot")) { |
| 613 | if err := fileOp.CopyDir(path.Join(oldPath, "system_snapshot"), newPath); err != nil { |
| 614 | return err |
| 615 | } |
| 616 | } |
| 617 | if fileOp.Stat(path.Join(oldPath, "website")) { |
| 618 | if err := fileOp.CopyDir(path.Join(oldPath, "website"), newPath); err != nil { |
| 619 | return err |
| 620 | } |
| 621 | } |
| 622 | if fileOp.Stat(path.Join(oldPath, "log")) { |
| 623 | if err := fileOp.CopyDir(path.Join(oldPath, "log"), newPath); err != nil { |
| 624 | return err |
| 625 | } |
| 626 | } |
| 627 | if fileOp.Stat(path.Join(oldPath, "master")) { |
| 628 | if err := fileOp.CopyDir(path.Join(oldPath, "master"), newPath); err != nil { |
| 629 | return err |
| 630 | } |
| 631 | } |
| 632 | _ = fileOp.RmRf(path.Join(oldPath, "app")) |
| 633 | _ = fileOp.RmRf(path.Join(oldPath, "database")) |
| 634 | _ = fileOp.RmRf(path.Join(oldPath, "directory")) |
| 635 | _ = fileOp.RmRf(path.Join(oldPath, "system_snapshot")) |
| 636 | _ = fileOp.RmRf(path.Join(oldPath, "website")) |
| 637 | _ = fileOp.RmRf(path.Join(oldPath, "log")) |
| 638 | _ = fileOp.RmRf(path.Join(oldPath, "master")) |
| 639 | return nil |
| 640 | } |