Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 1 | # BEGIN Store prev |
| 2 | BD=/opt/app/osaaf/backup |
| 3 | if [ -e "$BD/6day" ]; then |
| 4 | rm -Rf $BD/6day |
| 5 | fi |
| 6 | |
| 7 | PREV=$BD/6day |
| 8 | for D in $BD/5day $BD/4day $BD/3day $BD/2day $BD/yesterday; do |
| 9 | if [ -e "$D" ]; then |
| 10 | mv "$D" "$PREV" |
| 11 | fi |
| 12 | PREV="$D" |
| 13 | done |
| 14 | |
| 15 | if [ -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 |
| 21 | fi |
| 22 | |
| 23 | mkdir $BD/today |
| 24 | |
| 25 | # END Store prev |
| 26 | date |
| 27 | docker exec -t aaf_cass bash -c "mkdir -p /opt/app/cass_backup" |
| 28 | docker container cp $BD/cbackup.sh aaf_cass:/opt/app/cass_backup/backup.sh |
| 29 | # echo "login as Root, then run \nbash /opt/app/cass_backup/backup.sh" |
| 30 | docker exec -t aaf_cass bash /opt/app/cass_backup/backup.sh |
| 31 | docker container cp aaf_cass:/opt/app/cass_backup/. $BD/today |
| 32 | date |