-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatasync.sh
More file actions
17 lines (16 loc) · 839 Bytes
/
Copy pathdatasync.sh
File metadata and controls
17 lines (16 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
taskexecution=$(aws datasync start-task-execution --task-arn $1 --override-options Gid=NONE,Uid=NONE,PreserveDeletedFiles=REMOVE --region $AWS_DEFAULT_REGION | awk 'NF{ print $NF }' | sed 's/{//g' | sed 's/"//g' | sed 's/}//g')
rtn=$?
if [ $rtn = 0 ]; then
execute=$(aws datasync describe-task-execution --task-execution-arn $taskexecution --region $AWS_DEFAULT_REGION | grep "TransferStatus" | awk 'NF{ print $NF }' | sed 's/,$//' | sed 's/"//g')
while [ -z "$execute" ] || [ "$execute" = "PENDING" ]
do
sleep 20
echo "inprogress"
execute=$(aws datasync describe-task-execution --task-execution-arn $taskexecution --region $AWS_DEFAULT_REGION | grep "TransferStatus" | awk 'NF{ print $NF }' | sed 's/,$//' | sed 's/"//g')
sleep 10
done
echo "transfer completed"
else
echo "something wrong"
fi