no need to pass filename into backup_psql.py in ansible postgres backup. removing it

This commit is contained in:
Jonathan Math 2021-06-27 14:40:00 -06:00
parent a78dec3ed9
commit 0e81d2f346
2 changed files with 3 additions and 3 deletions

View file

@ -62,4 +62,4 @@
-v /backup/:/backup/
--network=newsblurnet
newsblur/newsblur_python3
/srv/newsblur/utils/backups/backup_psql.py /backup/$BACKUP_FILE $BUCKET
/srv/newsblur/utils/backups/backup_psql.py $BUCKET

View file

@ -8,11 +8,11 @@ sys.path.insert(0, NEWSBLUR_DIR)
import boto3
filename = sys.argv[1]
filename = os.listdir('/backup')[0]
print('Uploading %s to S3...' % filename)
s3 = boto3.resource('s3')
bucket = sys.argv[2]
bucket.upload_file(filename, name="postgres/%s" % filename.split("/")[1])
bucket.upload_file(f'/backup/{filename}', name="postgres/%s" % filename)
os.remove(filename)