Compare commits
No commits in common. "dcac3ad47b416ac6a57dcb20d91f766b41676d48" and "565d1b697c4ab10a5ff5d46b9b5a33a4afd753f8" have entirely different histories.
dcac3ad47b
...
565d1b697c
|
@ -18,6 +18,7 @@ Then configure `merlin-config.ini` and run using `./merlin`
|
||||||
- sort `arthur status` by last time synced
|
- sort `arthur status` by last time synced
|
||||||
- last sync runtime, time until next sync
|
- last sync runtime, time until next sync
|
||||||
- when sync fails, then make a copy of the rsync logs
|
- when sync fails, then make a copy of the rsync logs
|
||||||
|
- create `csc-sync-fedora` rather than using the `report_mirror` setting
|
||||||
|
|
||||||
### Completed
|
### Completed
|
||||||
- [x] add bwlimit option for each rsync process
|
- [x] add bwlimit option for each rsync process
|
||||||
|
|
|
@ -132,6 +132,8 @@ type Repo struct {
|
||||||
RsyncLogFile string `ini:"-"`
|
RsyncLogFile string `ini:"-"`
|
||||||
// full file path for file logging this repo's zfssync
|
// full file path for file logging this repo's zfssync
|
||||||
ZfssyncLogFile string `ini:"-"`
|
ZfssyncLogFile string `ini:"-"`
|
||||||
|
// determines if report_mirror should be run after the sync (default: false)
|
||||||
|
ReportMirror bool `ini:"report_mirror"`
|
||||||
// add the "-vv" flag to rsync commands and enable the Debug log (default: false)
|
// add the "-vv" flag to rsync commands and enable the Debug log (default: false)
|
||||||
Verbose bool `ini:"verbose"`
|
Verbose bool `ini:"verbose"`
|
||||||
// the repo will write its name and status in a Result struct to DoneChan
|
// the repo will write its name and status in a Result struct to DoneChan
|
||||||
|
@ -232,6 +234,7 @@ func LoadConfig(configPath string, doneChan chan SyncResult, stopChan chan struc
|
||||||
RepoLogFile: filepath.Join(newConf.RepoLogDir, repoName) + ".log",
|
RepoLogFile: filepath.Join(newConf.RepoLogDir, repoName) + ".log",
|
||||||
RsyncLogFile: filepath.Join(newConf.RsyncLogDir, repoName) + "-rsync.log",
|
RsyncLogFile: filepath.Join(newConf.RsyncLogDir, repoName) + "-rsync.log",
|
||||||
ZfssyncLogFile: filepath.Join(newConf.ZfssyncLogDir, repoName) + "-zfssync.log",
|
ZfssyncLogFile: filepath.Join(newConf.ZfssyncLogDir, repoName) + "-zfssync.log",
|
||||||
|
ReportMirror: false,
|
||||||
Verbose: false,
|
Verbose: false,
|
||||||
DoneChan: doneChan,
|
DoneChan: doneChan,
|
||||||
StopChan: stopChan,
|
StopChan: stopChan,
|
||||||
|
|
|
@ -51,12 +51,14 @@ rsync_host = rsync.dante.ctan.org
|
||||||
rsync_dir = CTAN
|
rsync_dir = CTAN
|
||||||
|
|
||||||
[fedora-epel]
|
[fedora-epel]
|
||||||
|
dry_run = true
|
||||||
verbose = true
|
verbose = true
|
||||||
sync_type = csc-sync-standard
|
sync_type = csc-sync-standard
|
||||||
frequency = bi-hourly
|
frequency = bi-hourly
|
||||||
local_dir = fedora/epel
|
local_dir = fedora/epel
|
||||||
rsync_host = mirrors.kernel.org
|
rsync_host = mirrors.kernel.org
|
||||||
rsync_dir = fedora-epel
|
rsync_dir = fedora-epel
|
||||||
|
report_mirror = true
|
||||||
|
|
||||||
[cygwin]
|
[cygwin]
|
||||||
sync_type = csc-sync-standard
|
sync_type = csc-sync-standard
|
||||||
|
@ -183,6 +185,7 @@ rsync_host = us-msync.centos.org
|
||||||
rsync_dir = CentOS
|
rsync_dir = CentOS
|
||||||
|
|
||||||
[opensuse]
|
[opensuse]
|
||||||
|
dry_run = true
|
||||||
verbose = true
|
verbose = true
|
||||||
; unsure what this setting is supposed to do
|
; unsure what this setting is supposed to do
|
||||||
; #"--exclude distribution/.timestamp_invisible"
|
; #"--exclude distribution/.timestamp_invisible"
|
||||||
|
@ -203,6 +206,7 @@ rsync_host = ftp2.uk.freebsd.org
|
||||||
rsync_dir = ftp.freebsd.org/pub/FreeBSD/
|
rsync_dir = ftp.freebsd.org/pub/FreeBSD/
|
||||||
|
|
||||||
[fedora-enchilada]
|
[fedora-enchilada]
|
||||||
|
dry_run = true
|
||||||
verbose = true
|
verbose = true
|
||||||
; csc-sync-standard fedora/linux mirrors.kernel.org fedora-enchilada/linux/ --ignore-errors && ~/bin/report_mirror >/dev/null
|
; csc-sync-standard fedora/linux mirrors.kernel.org fedora-enchilada/linux/ --ignore-errors && ~/bin/report_mirror >/dev/null
|
||||||
sync_type = csc-sync-standard
|
sync_type = csc-sync-standard
|
||||||
|
@ -210,6 +214,7 @@ frequency = bi-hourly
|
||||||
local_dir = fedora/linux
|
local_dir = fedora/linux
|
||||||
rsync_host = mirrors.kernel.org
|
rsync_host = mirrors.kernel.org
|
||||||
rsync_dir = fedora-enchilada/linux/
|
rsync_dir = fedora-enchilada/linux/
|
||||||
|
report_mirror = true
|
||||||
|
|
||||||
[ubuntu-ports-releases]
|
[ubuntu-ports-releases]
|
||||||
sync_type = csc-sync-standard
|
sync_type = csc-sync-standard
|
||||||
|
|
|
@ -50,5 +50,6 @@ func SyncCompleted(repo *config.Repo, exit int) {
|
||||||
|
|
||||||
if exit == config.SUCCESS {
|
if exit == config.SUCCESS {
|
||||||
go zfsSync(repo)
|
go zfsSync(repo)
|
||||||
|
go reportMirror(repo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,3 +146,15 @@ func zfsSync(repo *config.Repo) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func reportMirror(repo *config.Repo) {
|
||||||
|
if !repo.ReportMirror {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
repo.Logger.Debug("Running report_mirror")
|
||||||
|
err := exec.Command("/bin/sh", "/home/mirror/bin/report_mirror").Run()
|
||||||
|
if err != nil {
|
||||||
|
repo.Logger.Error(fmt.Errorf("Error running report_mirror: %w", err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue