X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=scandir.cc;h=03d84143a59768f78f470e769c557466f1faaf16;hb=2f5d9b51edebfd70f0e427dfb27ecb496bf53fe0;hp=818a460be8832340156830ec170c45b0077af31b;hpb=ca9a4006c4ffc86a24d653d1b1b68bec4a6fbfdf;p=cumulus.git diff --git a/scandir.cc b/scandir.cc index 818a460..03d8414 100644 --- a/scandir.cc +++ b/scandir.cc @@ -248,6 +248,7 @@ void dump_inode(const string& path, // Path within snapshot ssize_t len; printf("%s\n", path.c_str()); + metawriter->find(path); file_info["name"] = uri_encode(path); file_info["mode"] = encode_int(stat_buf.st_mode & 07777, 8); @@ -256,6 +257,11 @@ void dump_inode(const string& path, // Path within snapshot file_info["user"] = encode_int(stat_buf.st_uid); file_info["group"] = encode_int(stat_buf.st_gid); + time_t now = time(NULL); + if (now - stat_buf.st_ctime < 30 || now - stat_buf.st_mtime < 30) + if ((stat_buf.st_mode & S_IFMT) != S_IFDIR) + file_info["volatile"] = "1"; + struct passwd *pwd = getpwuid(stat_buf.st_uid); if (pwd != NULL) { file_info["user"] += " (" + uri_encode(pwd->pw_name) + ")"; @@ -320,6 +326,7 @@ void dump_inode(const string& path, // Path within snapshot if (file_size != stat_buf.st_size) { fprintf(stderr, "Warning: Size of %s changed during reading\n", path.c_str()); + file_info["volatile"] = "1"; } break;