Changes between Version 3 and Version 4 of S3QLMnt
- Timestamp:
- Oct 8, 2015, 12:51:36 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3QLMnt
v3 v4 8 8 9 9 {{{ 10 #!bash11 10 #!/bin/bash 12 11 … … 21 20 # s3ql server 22 21 SERVER="s3c://s.qstack.advania.com:443" 23 22 24 23 # check that the script is being run by root 25 24 if [[ "$(id -u)" != "0" ]] ; then … … 27 26 exit 2 28 27 fi 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 30 if [[ "$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 39 else 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 37 48 fi 38 49 39 50 # if force is wanted for filesystem check 40 if [[ $1 == "--force" ]]; then51 if [[ "$FORCE" = "1" ]]; then 41 52 # file system check with force 42 fsck.s3ql --force --batch ${SERVER}/${BUCKET} \53 fsck.s3ql --force --batch --backend-options="dumb-copy" ${SERVER}/${BUCKET} \ 43 54 || echo "Force filesystem check of ${SERVER}/${BUCKET} failed" 44 55 else 45 56 # file system check 46 fsck.s3ql --batch ${SERVER}/${BUCKET} \57 fsck.s3ql --batch --backend-options="dumb-copy" ${SERVER}/${BUCKET} \ 47 58 || echo "Filesystem check of ${SERVER}/${BUCKET} failed" 48 59 fi