/* * Amanda, The Advanced Maryland Automatic Network Disk Archiver * Copyright (c) 1991-1998 University of Maryland at College Park * All Rights Reserved. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of U.M. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. U.M. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Authors: the Amanda Development Team. Its members are listed in a * file named AUTHORS, in the root directory of this distribution. */ /* * $Id: amtape.c,v 1.47.2.2 2006/10/30 12:00:19 martinea Exp $ * * tape changer interface program */ #include "amanda.h" #include "conffile.h" #include "tapefile.h" #include "taperscan.h" #include "tapeio.h" #include "clock.h" #include "changer.h" #include "version.h" /* local functions */ void usage(void); int main(int argc, char **argv); void reset_changer(int argc, char **argv); void eject_tape(int argc, char **argv); void clean_tape(int argc, char **argv); void load_slot(int argc, char **argv); void load_label(int argc, char **argv); void show_slots(int argc, char **argv); void show_current(int argc, char **argv); void update_labeldb (int argc, char **argv); void amtape_taper_scan(int argc, char **argv); void show_device(int argc, char **argv); int update_one_slot (void *ud, int rc, char *slotstr, char *device); int loadlabel_slot(void *ud, int rc, char *slotstr, char *device); int show_init(void *ud, int rc, int ns, int bk, int s); int show_init_all(void *ud, int rc, int ns, int bk, int s); int show_init_current(void *ud, int rc, int ns, int bk, int s); int show_slot(void *ud, int rc, char *slotstr, char *device); static const struct { const char *name; void (*fn)(int, char **); const char *usage; } cmdtab[] = { { "reset", reset_changer, "reset Reset changer to known state" }, { "eject", eject_tape, "eject Eject current tape from drive" }, { "clean", clean_tape, "clean Clean the drive" }, { "show", show_slots, "show Show contents of all slots" }, { "current", show_current, "current Show contents of current slot" }, { "slot" , load_slot, "slot load tape from slot " }, { "slot" , load_slot, "slot current load tape from current slot" }, { "slot" , load_slot, "slot prev load tape from previous slot" }, { "slot" , load_slot, "slot next load tape from next slot" }, { "slot" , load_slot, "slot advance advance to next slot but do not load" }, { "slot" , load_slot, "slot first load tape from first slot" }, { "slot" , load_slot, "slot last load tape from last slot" }, { "label", load_label, "label