diff --git a/backup.sh b/backup.sh index ed31ba6..755a6b6 100644 --- a/backup.sh +++ b/backup.sh @@ -18,6 +18,8 @@ if [ $UID -ne 0 ] ; then exit 1 fi +backupdir=/var/backups/$(date -I) + while getopts hl OPTION ; do case $OPTION in (l) listBackups ${backupdir}/.. ; ;; @@ -26,9 +28,8 @@ while getopts hl OPTION ; do esac done -shift $((OPTIND -1)) +shift $(( OPTIND - 1)) -backupdir=/var/backups/$(date -I) mkdir -p $backupdir || myerror 2 "impossible de créer $backupdir" for dir in "$@" ; do