Changes between Version 3 and Version 4 of S3QLMnt


Ignore:
Timestamp:
Oct 8, 2015, 12:51:36 PM (3 years ago)
Author:
chris
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3QLMnt

    v3 v4  
    88
    99{{{
    10 #!bash
    1110#!/bin/bash
    1211
     
    2120# s3ql server
    2221SERVER="s3c://s.qstack.advania.com:443"
    23  
     22
    2423# check that the script is being run by root
    2524if [[ "$(id -u)" != "0" ]] ; then
     
    2726  exit 2
    2827fi
    29  
    30 # check for bucket name / directory on standard input
    31 if [[ $1 ]]; then
    32   BUCKET=$1
    33 elif [[ ! $1 ]]; then
    34   echo "Type the bucketname and then [ENTER]:"
    35   read bucket
    36   BUCKET=$bucket
     28
     29# check for the number of arguments
     30if [[ "$2" ]]; then
     31  if [[ "$1" == "--force" ]]; then
     32    # force needed
     33    FORCE="1"
     34    BUCKET="$2"
     35  else
     36    echo "Please use this command like this: $0 --force bucketname"
     37    exit 0
     38  fi
     39else
     40  # check for bucket name / directory on standard input
     41  if [[ $1 ]]; then
     42    BUCKET=$1
     43  elif [[ ! $1 ]]; then
     44    echo "Type the bucketname and then [ENTER]:"
     45    read bucket
     46    BUCKET=$bucket
     47  fi
    3748fi
    38  
     49
    3950# if force is wanted for filesystem check
    40 if [[ $1 == "--force" ]]; then
     51if [[ "$FORCE" = "1" ]]; then
    4152  # file system check with force
    42   fsck.s3ql --force --batch ${SERVER}/${BUCKET} \
     53  fsck.s3ql --force --batch --backend-options="dumb-copy" ${SERVER}/${BUCKET} \
    4354  || echo "Force filesystem check of ${SERVER}/${BUCKET} failed"
    4455else
    4556  # file system check
    46   fsck.s3ql --batch ${SERVER}/${BUCKET} \
     57  fsck.s3ql --batch --backend-options="dumb-copy" ${SERVER}/${BUCKET} \
    4758  || echo "Filesystem check of ${SERVER}/${BUCKET} failed"
    4859fi