#! /bin/zsh -f # backup script # Usage: jbackup [config_file] # uses configuration file ~/.jbackup by default # You may override the configuration file by setting DOTJBACKUP or # providing a filename # # Copyright (C) 2008 Joel J. Adamson # # 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 3, 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. # help_message () { if [[ "$1" = "NO_FILES" ]]; then printf "Error: no files to back up\n" elif [[ "$1" = "NO_DISK" ]]; then printf "Error: device %s not found\n" "$2" elif [[ "$1" = "NO_DESTINATION" ]]; then printf "Error: no backup destination specified\n" elif [[ "$1" = "RSYNC_ERROR" ]]; then printf "Error: rsync error \"%s\"" "$2" elif [[ "$1" = "NO_CONFIG" ]]; then printf "Error: no configuration found\n" elif [[ "$1" = "help" ]]; then : else printf "Unknown option\n" fi cat -<