Skip to content

Commit

Permalink
updated Oracle backup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Aug 31, 2023
1 parent 4b4f7ec commit 7e2406b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
9 changes: 8 additions & 1 deletion docker/database/backup_scripts/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
run ./archivedb.sh as root or with sudo to generate a dump in /data/backup
## Nightly Oracle database backups

### Data Pump dump to /data/backup
cron job runs `archivedb.sh` every 1:00am as `root`

### Compress and Archive to ~vcell/database_backups
cron job runs `move_files_to_vcellhome.sh` every 9:00pm as `vcell`

6 changes: 5 additions & 1 deletion docker/database/backup_scripts/archivedb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
# run export of oracle 19c database running in the container named 'oracle-database' using the Data Pump 'expdp' command
sudo docker exec -it oracle-database /opt/oracle/backup/scripts/run.sh 2>&1 | tee -a ../archivedb_$(date +%Y_%m_%d_%H_%M_%S).log

# change permission so that vcell can move them
chmod 666 /data/backup/*.log
chmod 666 /data/backup/*.dmp

# copy move dump file to remote storage
echo "move dump files to remote storage - not yet mounted - do this manually"
echo "move dump files to remote storage - not yet mounted - do this manually"
9 changes: 9 additions & 0 deletions docker/database/backup_scripts/move_files_to_vcellhome.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# compress all *.dmp files in /data/backup
cd /data/backup || echo "failed to cd to /data/backup" || exit 1
gzip *.dmp

# move
mv /data/backup/*.log ~vcell/database_backups
mv /data/backup/*.dmp.gz ~vcell/database_backups

0 comments on commit 7e2406b

Please sign in to comment.