blob: 1359d3de8309a1380a884c0f4597d92a29d9e0fa [file] [log] [blame]
Instrumental6433cd52018-04-16 14:28:44 -05001# BEGIN Store prev
Instrumental08770622018-04-18 10:52:42 -05002BD=/opt/app/osaaf/backup
3if [ -e "$BD/6day" ]; then
4 rm -Rf $BD/6day
Instrumental6433cd52018-04-16 14:28:44 -05005fi
6
Instrumental08770622018-04-18 10:52:42 -05007PREV=$BD/6day
8for D in $BD/5day $BD/4day $BD/3day $BD/2day $BD/yesterday; do
Instrumental6433cd52018-04-16 14:28:44 -05009 if [ -e "$D" ]; then
10 mv "$D" "$PREV"
11 fi
12 PREV="$D"
13done
14
Instrumental08770622018-04-18 10:52:42 -050015if [ -e "$BD/today" ]; then
16 if [ -e "$BD/backup.log" ]; then
17 mv $BD/backup.log $BD/today
18 fi
19 gzip $BD/today/*
20 mv $BD/today $BD/yesterday
Instrumental6433cd52018-04-16 14:28:44 -050021fi
22
Instrumental08770622018-04-18 10:52:42 -050023mkdir $BD/today
24
Instrumental6433cd52018-04-16 14:28:44 -050025# END Store prev
26date
27docker exec -t aaf_cass bash -c "mkdir -p /opt/app/cass_backup"
Instrumental08770622018-04-18 10:52:42 -050028docker container cp $BD/cbackup.sh aaf_cass:/opt/app/cass_backup/backup.sh
Instrumental6433cd52018-04-16 14:28:44 -050029# echo "login as Root, then run \nbash /opt/app/cass_backup/backup.sh"
30docker exec -t aaf_cass bash /opt/app/cass_backup/backup.sh
Instrumental08770622018-04-18 10:52:42 -050031docker container cp aaf_cass:/opt/app/cass_backup/. $BD/today
Instrumental6433cd52018-04-16 14:28:44 -050032date