ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame^] | 1 | WORKING_DIR=$1 |
| 2 | ASTERIX_INSTANCE_NAME=$2 |
| 3 | ASTERIX_DATA_DIR=$3 |
| 4 | BACKUP_ID=$4 |
| 5 | HDFS_URL=$5 |
| 6 | HADOOP_VERSION=$6 |
| 7 | HDFS_BACKUP_DIR=$7 |
| 8 | NODE_ID=$8 |
| 9 | |
| 10 | export HADOOP_HOME=$WORKING_DIR/hadoop-$HADOOP_VERSION |
| 11 | |
| 12 | nodeStores=$(echo $ASTERIX_DATA_DIR | tr "," "\n") |
| 13 | for nodeStore in $nodeStores |
| 14 | do |
| 15 | NODE_BACKUP_DIR=$HDFS_BACKUP_DIR/$ASTERIX_INSTANCE_NAME/$BACKUP_ID/$NODE_ID/$nodeStore |
| 16 | $HADOOP_HOME/bin/hadoop fs -mkdir $HDFS_URL/$NODE_BACKUP_DIR |
| 17 | echo "$HADOOP_HOME/bin/hadoop fs -copyFromLocal $nodeStore/$NODE_ID $HDFS_URL/$NODE_BACKUP_DIR" >> ~/backup.log |
| 18 | $HADOOP_HOME/bin/hadoop fs -copyFromLocal $nodeStore/$NODE_ID/$ASTERIX_INSTANCE_NAME/* $HDFS_URL/$NODE_BACKUP_DIR/ |
| 19 | done |