diff --git a/configs/synchro.sh b/configs/synchro.sh index 1d1af355..8fd8f8df 100755 --- a/configs/synchro.sh +++ b/configs/synchro.sh @@ -32,7 +32,7 @@ done & while ! [ -f SETTINGS/stop ] || [ /tmp/stop -nt SETTINGS/stop ] do # Synchronize static files pages - rsync -e "$SSH_OPTS" -av --delete PKI TEAMS SETTINGSDIST "${FRONTEND_HOSTNAME}":"${BASEDIR}" + rsync -e "$SSH_OPTS" -av --delete --delay-updates --partial-dir=.tmp/ PKI TEAMS SETTINGSDIST "${FRONTEND_HOSTNAME}":"${BASEDIR}" # Synchronize submissions rsync -e "$SSH_OPTS" -av --ignore-existing --delay-updates --temp-dir=.tmp/ --partial-dir=.tmp/ --remove-source-files "${FRONTEND_HOSTNAME}":"${BASEDIR}"/submissions/ submissions/ diff --git a/remote/challenge-sync-airbus/main.go b/remote/challenge-sync-airbus/main.go index 978502fa..11a58959 100644 --- a/remote/challenge-sync-airbus/main.go +++ b/remote/challenge-sync-airbus/main.go @@ -411,12 +411,19 @@ func main() { case ev := <-watcher.Events: d, err := os.Lstat(ev.Name) + if err == nil && strings.HasPrefix(d.Name(), ".") { + if *debugINotify { + log.Println("Skipped event:", ev, "for", ev.Name) + } + continue + } + if err == nil && watchedNotify == fsnotify.Create && ev.Op&fsnotify.Write == fsnotify.Write { log.Println("FSNOTIFY WRITE SEEN. Prefer looking at them, as it appears files are not atomically moved.") watchedNotify = fsnotify.Write } - if err == nil && ev.Op&fsnotify.Create == fsnotify.Create && d.Mode().IsDir() && d.Mode()&os.ModeSymlink == 0 && d.Name() != ".tmp" { + if err == nil && ev.Op&fsnotify.Create == fsnotify.Create && d.Mode().IsDir() && d.Mode()&os.ModeSymlink == 0 { // Register new subdirectory if err := watchsubdir(watcher, ev.Name); err != nil { log.Println(err) @@ -476,7 +483,7 @@ func watchsubdir(watcher *fsnotify.Watcher, pathname string) error { } else { for _, d := range ds { p := path.Join(pathname, d.Name()) - if d.IsDir() && d.Name() != ".tmp" && d.Mode()&os.ModeSymlink == 0 { + if d.IsDir() && !strings.HasPrefix(d.Name(), ".") && d.Mode()&os.ModeSymlink == 0 { if err := watchsubdir(watcher, p); err != nil { return err }