File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ concurrency:
1010 cancel-in-progress : true
1111
1212jobs :
13- direct-backup :
13+ direct-backup :
1414 runs-on : ubuntu-latest
1515 steps :
1616 - name : Install MongoDB tools
@@ -28,12 +28,12 @@ jobs:
2828 set -e
2929
3030 echo "Dumping specific databases..."
31- mongodump --uri "${{ secrets.MONGODB_URI }}" --db test --out ./temp_backup
31+ mongodump --uri "${{ secrets.MONGODB_URI }}" --db pbctf --out ./temp_backup
3232
3333 TIMESTAMP=$(date -u +%Y-%m-%dT%H-%M-%SZ)
3434
3535 echo "Restoring databases..."
36- mongorestore --uri "${{ secrets.BACKUP_URI }}" --db "test -$TIMESTAMP" --drop ./temp_backup/test
36+ mongorestore --uri "${{ secrets.BACKUP_URI }}" --nsFrom="pbctf.*" --nsTo="pbctf -$TIMESTAMP.* " --drop ./temp_backup
3737
3838 echo "Backup completed successfully for $TIMESTAMP"
3939
4343 const maxBackups = parseInt(process.env.MAX_BACKUPS);
4444
4545 // Cleanup
46- const testBackups = dbs.filter(name => name.startsWith("test -")).sort();
46+ const testBackups = dbs.filter(name => name.startsWith("pbctf -")).sort();
4747 if (testBackups.length > maxBackups) {
4848 const backupsToDelete = testBackups.slice(0, testBackups.length - maxBackups);
4949 backupsToDelete.forEach(dbName => {
5858 - name : Clean up local files
5959 if : always()
6060 run : |
61- rm -rf ./temp_backup
61+ rm -rf ./temp_backup
You can’t perform that action at this time.
0 commit comments