X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=remote.h;h=a2801da1dfc463d93a0b2e3e0000742ad434f816;hb=2911a4279cce1e880793c934ce90a187856c7c92;hp=705fe805f1212d325aa059ec90349b00e10d172f;hpb=dfb3bcd8cbcc6aa8737deddd332884e23d0e4b22;p=cumulus.git diff --git a/remote.h b/remote.h index 705fe80..a2801da 100644 --- a/remote.h +++ b/remote.h @@ -1,7 +1,24 @@ -/* LBS: An LFS-inspired filesystem backup system - * Copyright (C) 2006 Michael Vrable +/* Cumulus: Smart Filesystem Backup to Dumb Servers * - * Backup data (segments and backup descriptors) may be stored on a remote + * Copyright (C) 2008 The Regents of the University of California + * Written by Michael Vrable + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* Backup data (segments and backup descriptors) may be stored on a remote * fileserver instead of locally. The only local storage needed is for the * local database and some temporary space for staging files before they are * transferred to the remote server. @@ -24,7 +41,9 @@ public: RemoteStore(const std::string &stagedir); ~RemoteStore(); - RemoteFile *alloc_file(const std::string &name); + void set_script(const std::string &script) + { backup_script = script; } + RemoteFile *alloc_file(const std::string &name, const std::string &type); void enqueue(RemoteFile *file); void sync(); @@ -33,7 +52,7 @@ private: pthread_mutex_t lock; pthread_cond_t cond; - std::string staging_dir; + std::string staging_dir, backup_script; bool terminate; // Set when thread should shut down bool busy; // True while there are pending transfers std::list transfer_queue; @@ -63,12 +82,13 @@ private: friend class RemoteStore; RemoteFile(RemoteStore *remote, - const std::string &name, const std::string &local_path); + const std::string &name, const std::string &type, + const std::string &local_path); RemoteStore *remote_store; int fd; - std::string local_path; + std::string type, local_path; std::string remote_path; };