blob: cff37df6ea39a6a0e86b4f65e7d6b6dc3fc73480 [file] [log] [blame]
ramangrover29116eb972013-02-20 20:47:35 +00001WORKING_DIR=$1
2ASTERIX_INSTANCE_NAME=$2
3ASTERIX_DATA_DIR=$3
4BACKUP_ID=$4
5HDFS_URL=$5
6HADOOP_VERSION=$6
7HDFS_BACKUP_DIR=$7
8NODE_ID=$8
9
10export HADOOP_HOME=$WORKING_DIR/hadoop-$HADOOP_VERSION
11
12nodeStores=$(echo $ASTERIX_DATA_DIR | tr "," "\n")
13for nodeStore in $nodeStores
14do
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/
19done