remove zfssync
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
dda2f71b2d
commit
363073f818
|
@ -3,15 +3,18 @@
|
|||
|
||||
This folder contains the code for merlin (which does the actual syncing) and arthur (which sends commands to merlin).
|
||||
|
||||
Check out the the [mirror env](https://git.csclub.uwaterloo.ca/public/mirror-env) for a testing environment
|
||||
|
||||
### TODO
|
||||
- [ ] ensure that the proper permissions (file mode, group, user) are used
|
||||
- [ ] detect if an rsync process is stuck (\*\*)
|
||||
- [ ] place each rsync process in a separate cgroup (\*\*\*)
|
||||
- [ ] ensure that the proper permissions (file mode, group, user) are being used
|
||||
- [ ] document configs
|
||||
- [ ] detect if an rsync process is stuck (optional) (\*\*)
|
||||
- [ ] add bwlimit option for each rsync process (\*\*\*)
|
||||
|
||||
\*\* This is optional. If you decide to implement it, you may want to watch the
|
||||
stdout/stderr of the rsync process.
|
||||
|
||||
\*\*\* I need to do more research into this - don't worry about it for now.
|
||||
\*\* watch the stdout/stderr of the rsync processes
|
||||
|
||||
\*\*\* previously wanted to place each rsync process in a separate cgroup
|
||||
|
||||
### Completed
|
||||
- [x] write process manager
|
||||
|
|
|
@ -53,9 +53,11 @@ func SyncCompleted(repo *config.Repo, exit int) {
|
|||
repo.SaveState()
|
||||
repo.Logger.Info(fmt.Sprintf("Sync "+exitStr+" after running for %d seconds, will run again in %d seconds", syncTook, nextSync))
|
||||
|
||||
// TODO: make it possible for this SyncCompleted to be run without zfsSync being run
|
||||
if exit == config.SUCCESS {
|
||||
// it is possible that the zfssync from the last repo sync is still running is that fine?
|
||||
go zfsSync(repo)
|
||||
}
|
||||
// We are no longer creating snapshots so we don't need the zfssync script anymore
|
||||
|
||||
// // TODO: make it possible for this SyncCompleted to be run without zfsSync being run
|
||||
// if exit == config.SUCCESS {
|
||||
// // it is possible that the zfssync from the last repo sync is still running is that fine?
|
||||
// go zfsSync(repo)
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -111,17 +111,16 @@ func startSync(repo *config.Repo) {
|
|||
}
|
||||
}
|
||||
|
||||
func zfsSync(repo *config.Repo) {
|
||||
out, err := exec.Command("/home/mirror/bin/zfssync", repo.Name).CombinedOutput()
|
||||
if err != nil {
|
||||
repo.Logger.Error(err)
|
||||
} else {
|
||||
f, err := os.OpenFile(repo.ZfssyncLogFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
|
||||
if err != nil {
|
||||
repo.Logger.Error(err.Error())
|
||||
} else {
|
||||
f.Write(out)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// func zfsSync(repo *config.Repo) {
|
||||
// out, err := exec.Command("/home/mirror/bin/zfssync", repo.Name).CombinedOutput()
|
||||
// if err != nil {
|
||||
// repo.Logger.Error(err)
|
||||
// } else {
|
||||
// f, err := os.OpenFile(repo.ZfssyncLogFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
|
||||
// if err != nil {
|
||||
// repo.Logger.Error(err.Error())
|
||||
// } else {
|
||||
// f.Write(out)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
|
Loading…
Reference in New Issue