Instrumental | 6433cd5 | 2018-04-16 14:28:44 -0500 | [diff] [blame] | 1 | # BEGIN Store prev |
Instrumental | 0877062 | 2018-04-18 10:52:42 -0500 | [diff] [blame] | 2 | BD=/opt/app/osaaf/backup |
| 3 | if [ -e "$BD/6day" ]; then |
| 4 | rm -Rf $BD/6day |
Instrumental | 6433cd5 | 2018-04-16 14:28:44 -0500 | [diff] [blame] | 5 | fi |
| 6 | |
Instrumental | 0877062 | 2018-04-18 10:52:42 -0500 | [diff] [blame] | 7 | PREV=$BD/6day |
| 8 | for D in $BD/5day $BD/4day $BD/3day $BD/2day $BD/yesterday; do |
Instrumental | 6433cd5 | 2018-04-16 14:28:44 -0500 | [diff] [blame] | 9 | if [ -e "$D" ]; then |
| 10 | mv "$D" "$PREV" |
| 11 | fi |
| 12 | PREV="$D" |
| 13 | done |
| 14 | |
Instrumental | 0877062 | 2018-04-18 10:52:42 -0500 | [diff] [blame] | 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 |
Instrumental | 6433cd5 | 2018-04-16 14:28:44 -0500 | [diff] [blame] | 21 | fi |
| 22 | |
Instrumental | 0877062 | 2018-04-18 10:52:42 -0500 | [diff] [blame] | 23 | mkdir $BD/today |
| 24 | |
Instrumental | 6433cd5 | 2018-04-16 14:28:44 -0500 | [diff] [blame] | 25 | # END Store prev |
| 26 | date |
| 27 | docker exec -t aaf_cass bash -c "mkdir -p /opt/app/cass_backup" |
Instrumental | 0877062 | 2018-04-18 10:52:42 -0500 | [diff] [blame] | 28 | docker container cp $BD/cbackup.sh aaf_cass:/opt/app/cass_backup/backup.sh |
Instrumental | 6433cd5 | 2018-04-16 14:28:44 -0500 | [diff] [blame] | 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 |
Instrumental | 0877062 | 2018-04-18 10:52:42 -0500 | [diff] [blame] | 31 | docker container cp aaf_cass:/opt/app/cass_backup/. $BD/today |
Instrumental | 6433cd5 | 2018-04-16 14:28:44 -0500 | [diff] [blame] | 32 | date |