Skip to content

Commit

Permalink
save to pvc?
Browse files Browse the repository at this point in the history
  • Loading branch information
hannah-macdonald1 committed Feb 2, 2024
1 parent 7003170 commit b7b6c6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions containers/db_cleanup/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WORKDIR /app

# Ensure that the user can access all application files
RUN chmod -R g+rwX /app
RUN chmod -R g+rwX /deleted

# Install dependencies based on the preferred package manager
COPY package.json package-lock.json* ./
Expand Down
7 changes: 4 additions & 3 deletions containers/db_cleanup/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ const fileTimeString = now.format('YYYY-MM-DD-HH-mm-ss');
const retainUntilString = retainUntil.format('YYYY-MM-DD HH:mm:ss.SSS ZZ');

// Create directory for entries
const dir = `./deleted/${fileTimeString}`
const dir = path.join(__dirname, '../', `deleted`,`${fileTimeString}`)
if (!fs.existsSync(dir)){
fs.mkdirSync(dir, { recursive: true });
}

// Create files
const vhersOutFile = path.join( __dirname, 'deleted', fileTimeString, 'vhers_audit_log.csv');
const pinOutFile = path.join( __dirname, 'deleted', fileTimeString, 'pin_audit_log.csv');
const vhersOutFile = path.join( __dirname, '../', 'deleted', fileTimeString, 'vhers_audit_log.csv');
const pinOutFile = path.join( __dirname, '../', 'deleted', fileTimeString, 'pin_audit_log.csv');

const vhersWriteStream = fs.createWriteStream(vhersOutFile);
const pinWriteStream = fs.createWriteStream(pinOutFile);

Expand Down

0 comments on commit b7b6c6d

Please sign in to comment.