/*
- Copyright (C) 2000, 2001 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald and John Walker
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.
+ 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.
+ 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., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
- 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
parameters needed to deal with FreeBSD tape drivers.
License:
-For the most part, Bacula is licensed under GPL version 2 or greater.
-Bacula may be linked with any libraries permitted under the GPL, or
-with any non-GPLed libraries, including OpenSSL, that are required for
-its proper functioning, providing the source code of those non-GPLed
-libraries is freely available.
+For the most part, Bacula is licensed under the GPL version 2 or greater
+with the following two additions:
+
+Linking: Bacula may be linked with any libraries permitted under
+the GPL, or with any non-GPLed libraries, including OpenSSL, that
+are required for its proper functioning, providing the source
+code of those non-GPLed libraries is non-proprietary and freely available.
+
+Termination for Patent Action: In addition to the termination
+clause specified in the GPL, this license shall terminate
+automatically and you may no longer exercise any of the rights
+granted to you by this license as of the date you commence an
+action, including a cross-claim or counterclaim, against any
+licensor of GPL software alleging that the software infringes a
+copyright, an intellectual property right, or a patent.
+=====================================
-In addition to GPL, there are also parts of Bacula that are licensed
-under LGPL so that they may be used in proprietary code to interface
-with Bacula, and there are parts that are in the public domain.
+In addition to the GPL, there are parts of Bacula that are licensed
+under the LGPL so that they may be used in proprietary code to interface
+with Bacula.
+
+Finally there are parts of Bacula that are in the public domain.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
static void usage()
{
fprintf(stderr, _(
+"Copyright (C) 2000-2004 Kern Sibbald and John Walker\n"
"\nVersion: " VERSION " (" BDATE ") %s %s %s\n\n"
"Usage: bconsole [-s] [-c config_file] [-d debug_level]\n"
" -c <file> set configuration file to file\n"
static void usage()
{
fprintf(stderr, _(
+"Copyright (C) 2000-2004 Kern Sibbald and John Walker\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: dird [-f -s] [-c config_file] [-d debug_level] [config_file]\n"
" -c <file> set configuration file to file\n"
# 6
:List all backups for a Client
*Enter Client Name:
-SELECT DISTINCT Job.JobId,Client.Name as Client,Level,StartTime,JobFiles,JobBytes,VolumeName
+SELECT DISTINCT Job.JobId as JobId,Client.Name as Client,Level,StartTime,
+ JobFiles,JobBytes,VolumeName
FROM Client,Job,JobMedia,Media
WHERE Client.Name='%1'
AND Client.ClientId=Job.ClientId
/* For ua_cmds.c */
const char *list_pool = "SELECT * FROM Pool WHERE PoolId=%u";
+/* For ua_dotcmds.c */
+const char *client_backups =
+"SELECT DISTINCT Job.JobId,Client.Name as Client,Level,StartTime,"
+"JobFiles,JobBytes,VolumeName"
+" FROM Client,Job,JobMedia,Media"
+" WHERE Client.Name='%s'"
+" AND Client.ClientId=Job.ClientId"
+" AND JobStatus='T'"
+" AND JobMedia.JobId=Job.JobId AND JobMedia.MediaId=Media.MediaId"
+" ORDER BY Job.StartTime";
+
+
/* ====== ua_prune.c */
const char *cnt_File = "SELECT count(*) FROM File WHERE JobId=%u";
extern int r_last;
extern struct s_res resources[];
extern char my_name[];
+extern const char *client_backups;
/* Imported functions */
extern int qmessagescmd(UAContext *ua, const char *cmd);
static int storagecmd(UAContext *ua, const char *cmd);
static int defaultscmd(UAContext *ua, const char *cmd);
static int typescmd(UAContext *ua, const char *cmd);
+static int backupscmd(UAContext *ua, const char *cmd);
static int levelscmd(UAContext *ua, const char *cmd);
struct cmdstruct { const char *key; int (*func)(UAContext *ua, const char *cmd); const char *help; };
{ N_(".msgs"), msgscmd, NULL},
{ N_(".pools"), poolscmd, NULL},
{ N_(".types"), typescmd, NULL},
+ { N_(".backups"), backupscmd, NULL},
{ N_(".levels"), levelscmd, NULL},
{ N_(".storage"), storagecmd, NULL},
{ N_(".defaults"), defaultscmd, NULL},
return 1;
}
+static int client_backups_handler(void *ctx, int num_field, char **row)
+{
+ UAContext *ua = (UAContext *)ctx;
+ bsendmsg(ua, "| %s | %s | %s | %s | %s | %s | %s |\n",
+ row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7]);
+ return 0;
+}
+
+static int backupscmd(UAContext *ua, const char *cmd)
+{
+ if (!open_db(ua)) {
+ return 1;
+ }
+ if (ua->argc == 2 && strcmp(ua->argk[1], "client") != 0) {
+ return 1;
+ }
+ Mmsg(&ua->cmd, client_backups, ua->argv[1]);
+ if (!db_sql_query(ua->db, ua->cmd, client_backups_handler, (void *)ua)) {
+ bsendmsg(ua, _("Query failed: %s. ERR=%s\n"), ua->cmd, db_strerror(ua->db));
+ return 1;
+ }
+ return 1;
+}
+
+
static int levelscmd(UAContext *ua, const char *cmd)
{
bsendmsg(ua, "Incremental\n");
static void usage()
{
fprintf(stderr, _(
+"Copyright (C) 2000-2004 Kern Sibbald and John Walker\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: bacula-fd [-f -s] [-c config_file] [-d debug_level]\n"
" -c <file> use <file> as configuration file\n"
static void usage()
{
fprintf(stderr, _(
+"Copyright (C) 2002-2004 Kern Sibbald and John Walker.\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: bcopy [-d debug_level] <input-archive> <output-archive>\n"
" -b bootstrap specify a bootstrap file\n"
static void usage()
{
fprintf(stderr,
+"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: bextract <options> <bacula-archive-device-name> <directory-to-store-files>\n"
" -b <file> specify a bootstrap file\n"
static void usage()
{
fprintf(stderr,
+"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: bls [-d debug_level] <physical-device-name>\n"
" -b <file> specify a bootstrap file\n"
static void usage()
{
fprintf(stderr, _(
+"Copyright (C) 2001-2004 Kern Sibbald and John Walker.\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: bscan [ options ] <bacula-archive>\n"
" -b bootstrap specify a bootstrap file\n"
static void usage()
{
fprintf(stderr, _(
+"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: btape <options> <device_name>\n"
" -b <file> specify bootstrap file\n"
static void usage()
{
fprintf(stderr, _(
+"Copyright (C) 2000-2004 Kern Sibbald and John Walker.\n"
"\nVersion: " VERSION " (" BDATE ")\n\n"
"Usage: stored [options] [-c config_file] [config_file]\n"
" -c <file> use <file> as configuration file\n"
/* */
#undef VERSION
#define VERSION "1.35.1"
-#define BDATE "27 July 2004"
-#define LSMDATE "27Jul04"
+#define BDATE "28 July 2004"
+#define LSMDATE "28Jul04"
/* Debug flags */
#undef DEBUG