Skip to content

Commit f47c02b

Browse files
Moved old backup logic files in old folder
1 parent d0cbcc5 commit f47c02b

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

Diff for: devops/linux/docker/backup_restore/dgraph-backup.py renamed to devops/linux/docker/backup_restore/dgraph-backup-api.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ def create_folder_if_not_exists(folder_path):
2121

2222

2323
# Function to fetch data for a single ID
24-
def fetch_data_for_id(gid):
24+
def fetch_data_for_id(gidList):
25+
print("Backing up data for {}".format(gidList))
2526
get_expanded_golden_record = f'http://{host}:{port}/JeMPI/expandedGoldenRecords'
26-
payload = json.dumps({"uidList": gid})
27+
payload = json.dumps({"uidList": gidList})
2728
headers = {'Content-Type': 'application/json'}
2829
response = requests.post(get_expanded_golden_record, headers=headers, data=payload)
2930
return response.json() if response.status_code == 200 else None

Diff for: devops/linux/docker/backup_restore/dgraph-backup-api.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pushd .
3535
pushd "$backup_restore_dir" || exit
3636
sleep 20
3737
echo "Started Backup through API"
38-
$python_cmd dgraph-backup.py $BACKUP_DATE_TIME
38+
$python_cmd dgraph-backup-api.py $BACKUP_DATE_TIME
3939
sleep 10
4040
popd || exit
4141
}

Diff for: devops/linux/docker/backup_restore/dgraph-restore-api.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ while true; do
6666
done
6767

6868
BACKUP_DIR="${DGRAPH_BACKUP_DIRECTORY}/$BACKUP_FOLDER_NAME"
69-
backup_data() {
69+
restore_data() {
7070
pushd "$backup_restore_dir"
7171
local dir=$1
7272
echo "$backup_restore_dir"
73-
echo "$dir"
7473
sleep 20
7574
echo "Started Restore through API"
7675
$python_cmd dgraph-restore-api.py $dir
@@ -87,8 +86,8 @@ source helper/bootstrapper/bootstrapper-docker.sh data resetAll
8786

8887
for backup_file in ${BACKUP_DIR}/dgraph_backup*.json; do
8988
# Assuming the first directory is for alpha nodes
90-
echo "innnn"
91-
backup_data $backup_file
89+
echo "Backup file found : $backup_file"
90+
restore_data $backup_file
9291
done
9392

9493
start_services

0 commit comments

Comments
 (0)