#!/bin/sh _usage() { echo "USAGE: llx-l10n-virtaal-backup [backup|list]" echo "USAGE: llx-l10n-virtaal-backup [restore NAME]" } _backup() { BACKUPNAME=virtaal_backup_$(date +%Y%m%d_%H%M%S).tar logger -t llx-l10n-tools -s "Creating backup for .virtaal on $USERNAME to $HOME/virtaalbackups/$BACKUPNAME" mkdir -p "$HOME/virtaalbackups/" tar -cvf "$HOME/virtaalbackups/$BACKUPNAME" $HOME/.virtaal/* } _list() { ls -1 "$HOME/virtaalbackups/" } _restore() { echo "RESTORE" } # Main case $1 in backup) _backup ;; list) _list ;; restore) _restore ;; *) _usage ;; esac