diff --git a/fuse/sfs.c b/fuse/sfs.c index 3d86c38..9e8a143 100644 --- a/fuse/sfs.c +++ b/fuse/sfs.c @@ -253,6 +253,9 @@ int sfs_link(const char *path, const char *newpath) { retstat = -errno; } else { batch_file_event (newpath, "norec"); + // add old path as event too to ensure that hardlinks are + // created on targets when rsync -H is used + batch_file_event(path, "norec"); } return retstat; @@ -914,7 +917,7 @@ int sfs_create(const char *path, mode_t mode, struct fuse_file_info *fi) { sfs_fullpath(fpath, path); BEGIN_PERM; - fd = creat(fpath, mode); + fd = open(fpath, fi->flags, mode); END_PERM; if (fd < 0) { retstat = -errno; diff --git a/php-sync/sync.php b/php-sync/sync.php old mode 100644 new mode 100755 index a07c331..fc586e5 --- a/php-sync/sync.php +++ b/php-sync/sync.php @@ -352,15 +352,13 @@ public function scheduleBatches ($mode, $toSchedule) { ) { # flush bulk if ($mtime === FALSE) { - syslog(LOG_WARN, "Cannot get mtime of $batchFile, assuming new bulk"); + syslog(LOG_WARNING, "Cannot get mtime of $batchFile, assuming new bulk"); } if ($bulkCount > 0) { $tasks[$rowno++][] = array($node, $bulk); } $bulk = array(); $bulkCount = 0; - $lastType = null; - break; // we don't send more than one bulk per node, anyway } $bulk[] = $batch; @@ -457,7 +455,7 @@ public function linkLocalBatches () { } foreach ($batches as &$batch) { - if (!preg_match ("/^[^_]+_([^_]+)_[^.]+\.batch$/", $batch, $match)) { + if (!preg_match ("/^\d+_([^_]+)_.*\.batch$/", $batch, $match)) { continue; } $batchNode = $match[1];