]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/recycle.c
Convert to pure GPL v2 license.
[bacula/bacula] / bacula / src / dird / recycle.c
index b8d0fc9d5615fa9776c3852e3135f591ad697427..2c01fe3b94f106ec9197509d6151aed98f3f39ac 100644 (file)
@@ -7,21 +7,33 @@
  *
  *   Version $Id$
  */
-
 /*
-   Copyright (C) 2002-2006 Kern Sibbald
+   Bacula® - The Network Backup Solution
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
+   Copyright (C) 2002-2006 Free Software Foundation Europe e.V.
 
-   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 
-   the file LICENSE for additional details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
- */
+   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.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 #include "dird.h"
@@ -70,7 +82,7 @@ bool recycle_oldest_purged_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr)
    const char *select =
           "SELECT MediaId,LastWritten FROM Media "
           "WHERE PoolId=%s AND Recycle=1 AND VolStatus='Purged' "
-          "AND MediaType='%s' %s"
+          "AND Enabled=1 AND MediaType='%s' %s"
           "ORDER BY LastWritten ASC,MediaId LIMIT 1";
 
    Dmsg0(100, "Enter recycle_oldest_purged_volume\n");
@@ -116,6 +128,7 @@ int recycle_volume(JCR *jcr, MEDIA_DBR *mr)
    mr->VolJobs = mr->VolFiles = mr->VolBlocks = mr->VolErrors = 0;
    mr->VolBytes = 1;
    mr->FirstWritten = mr->LastWritten = 0;
+   mr->RecycleCount++;
    mr->set_first_written = true;
    return db_update_media_record(jcr, jcr->db, mr);
 }